none
Печать из DOS с правами опытного пользователя RRS feed

  • Вопрос

  • Доброе время суток коллеги!

    Возникла задача: есть программа, написанная под DOS, для того, чтобы она печатала выполняется команда

    net use LPT1: \\server\printer  /persist: yes

    После этого в этот LPT1 прога и печатает. Вот в том то и дело, что печатает она только тогда, когда у пользователя парва администратора, с правами опытного пользователя "net use" подключает принтер, но печать из программы не идет.

    Вопрос такой: что-же этому DOS'овскому чудовищу нужно?

    Заранее спасибо.

    PS: ось WIN XP sp2 Rus, домен Win2k3 native

    25 октября 2006 г. 10:45
    Отвечающий

Ответы

  • Non-Administrators Cannot Remap an LPT Port to a Network Printer

    Относится к
    This article was previously published under Q313644

    SYMPTOMS

    When a user who is not an administrator tries to use the net use command to remap an LPT port to a network printer (for example, net use lpt1: \\printer server\print share), and the LPT port is already assigned to the local parallel port, the LPT port is not remapped. A use who is not an administrator can still map a network printer to an LPT port that is not already assigned to a local parallel-port.

    CAUSE

    This behavior occurs because only a member of the Administrators group can use the net use command to map the LPT port for a local (hardware) parallel port to a network printer. This behavior is designed to help improve security.

    RESOLUTION

    To work around this behavior, use one of the following methods:
    • Log on as an administrator, and then use the net use command.
    • Use the devcon disable *PNP0401 command to disable the LPT port mapping to the local parallel port when the computer starts. The devcon disable *PNP0401 command is for LPT1. To find the hardware ID for other LPT ports, use the devcon findall * command. The devcon command must run when the computer starts. For a computer in a domain, you can set up Group Policy to run devcon as a computer startup script. To set Group Policy, open the appropriate group policy, open Computer Configuration\Windows Settings\Scripts (Startup/Shutdown)\Startup, and then add the command.
    • If your program can print to the LPT2 port or the LPT3 port, use the net use command to map the network printer to the LPT2 port or the LPT3 port. Most computers do not have physical LPT2 or LPT3 ports, so a non-administrator can map an LPT2 port or an LPT3 port to a network printer.

    STATUS

    This behavior is by design.

    MORE INFORMATION

    The Devcon.exe tool is included with the Windows XP DDK. For additional information about Devcon.exe, including how to download and run it, click the following article number to view the article in the Microsoft Knowledge Base:

    311272 FILE: DevCon Command Line Utility Alternative to Device Manager

    Качаем утилитку DEVCON  и да будет счастье

    PS.:Загрузить пакет DevCon (http://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-9ce67f3e0240/devcon.exe) Дата выпуска: 29 января 2003 г.

    25 октября 2006 г. 11:10

Все ответы

  • Non-Administrators Cannot Remap an LPT Port to a Network Printer

    Относится к
    This article was previously published under Q313644

    SYMPTOMS

    When a user who is not an administrator tries to use the net use command to remap an LPT port to a network printer (for example, net use lpt1: \\printer server\print share), and the LPT port is already assigned to the local parallel port, the LPT port is not remapped. A use who is not an administrator can still map a network printer to an LPT port that is not already assigned to a local parallel-port.

    CAUSE

    This behavior occurs because only a member of the Administrators group can use the net use command to map the LPT port for a local (hardware) parallel port to a network printer. This behavior is designed to help improve security.

    RESOLUTION

    To work around this behavior, use one of the following methods:
    • Log on as an administrator, and then use the net use command.
    • Use the devcon disable *PNP0401 command to disable the LPT port mapping to the local parallel port when the computer starts. The devcon disable *PNP0401 command is for LPT1. To find the hardware ID for other LPT ports, use the devcon findall * command. The devcon command must run when the computer starts. For a computer in a domain, you can set up Group Policy to run devcon as a computer startup script. To set Group Policy, open the appropriate group policy, open Computer Configuration\Windows Settings\Scripts (Startup/Shutdown)\Startup, and then add the command.
    • If your program can print to the LPT2 port or the LPT3 port, use the net use command to map the network printer to the LPT2 port or the LPT3 port. Most computers do not have physical LPT2 or LPT3 ports, so a non-administrator can map an LPT2 port or an LPT3 port to a network printer.

    STATUS

    This behavior is by design.

    MORE INFORMATION

    The Devcon.exe tool is included with the Windows XP DDK. For additional information about Devcon.exe, including how to download and run it, click the following article number to view the article in the Microsoft Knowledge Base:

    311272 FILE: DevCon Command Line Utility Alternative to Device Manager

    Качаем утилитку DEVCON  и да будет счастье

    PS.:Загрузить пакет DevCon (http://download.microsoft.com/download/1/1/f/11f7dd10-272d-4cd2-896f-9ce67f3e0240/devcon.exe) Дата выпуска: 29 января 2003 г.

    25 октября 2006 г. 11:10
  • Вообщем LPT1 я в девайсах перед этим отключал. Однако попробую и это...
    25 октября 2006 г. 11:13
    Отвечающий