Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net Use command in Windows 2000 Server

Status
Not open for further replies.

invisio

Technical User
Feb 2, 2005
7
GB
Hi all, I am trying to make a PRINTER dos mapping using the NET USE comamnd from a Windows 2000 Server to an XP workstation and although it all works correctly it does not remain persistent when I log off or reboot even when using the /P:yes at the end of the command.

Now I know I can make a batch file, but this does not help as none of users at the site have administrative rights to the server, so they cannot logon and invoke the script if it is rebooted or if the XP machine is rebooted.

It is done this way as the this lone XP machine is on the other side of a VPN and if you print directly from another workstation on the server side the PC grinds to a halt while spooling several megabyte files and that why we let the server do the spooling.

Any help or alternative ideas greatly appreciated.

Many thanks in advance.
 
Ere mate, what type of router are you using for the VPN?



..EB


"Smoke me a kipper, I'll be back for breakfast!"

"Captain A.J. Rimmer, Space Adventurer!"
 
Are you sure the account adding the printer has the ability to have profile changes on logout? Are you using Mandatory profiles?
 
invisio - I'm not sure if I follow your problem exactly, but if you map a printer on the server console, as soon as you log out of the server console, the mapping is lost. The mapping only pertains the user profile currently logged into the system.

You would need to login into the server console, map the printer, then lock the workstation (not log out), to maintain the mapping.
 
On both the PC and the Server there is a usrlogon.cmd file. This activates each time a user logs onto their PC or alternatively on the server.

Find the file in C:\winnt\system32\ folder and edit it to use the net use ltp1 \\server\printsharename.

That way each time a user logs on the printer is captured to Lpt1.

Or for more than one user create a VB or Kix script with the con2prt.exe command. Execute the batch file via usrlogon.cmd to a code as below. In this case it is printers.kix script.

SELECT
CASE InGroup("DOMAIN\UserGroup") ; $PrintServer = "xxxxx"
$printer1 = "xxxxxx"

CASE InGroup("DOMAIN\User2Group") ; $PrintServer = "xxxxx"
$printer1 = "xxxxxx"


ENDSELECT

If $PrintServer
; Connect to Printer1
If $Printer1
RUN "CON2PRT.EXE /cd \\$PrintServer\$printer1"
Use lpt1: "\\$PrintServer\$printer1"
endif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top