batch file

how to write batch file to capture a printer on startup in windows 2000
lsbrown1Asked:
Who is Participating?
 
Pete LongConnect With a Mentor Technical ConsultantCommented:
you need a net use lpt command

net use lpt1 \\machinename\sharename /Y

or

net use lpt1 \\machinename\sharename\ /user:username password /Y

or

RUNDLL32 PRINTUI.DLL,PrintUIEntry /dn /n\\COMPUTERNAME\PRINTERNAME      // removes printer    
RUNDLL32 PRINTUI.DLL,PrintUIEntry /in /n\\COMPUTERNAME\PRINTERNAME       // adds printer

Zero Administration Kit
http://www.microsoft.com/ntworkstation/downloads/Recommended/Featured/NTZAK.asp

How to Use Con2prt.exe to Connect to a Network Printer
http://support.microsoft.com/?kbid=181663
0
 
Steve KnightIT ConsultancyCommented:
Maybe I am missing something here with the /Y but you should be able to just use /persistent:yes to make it come back after a reboot.  This is user based though so if you want it to happen for different users they will all need it setup.

net use lpt1 \\server\printershare /persistent:yes
0
 
lsbrown1Author Commented:
this device will login to terminal service
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Pete LongTechnical ConsultantCommented:
/Y

does the same as

/persistent:yes

m8 :)
0
 
Steve KnightIT ConsultancyCommented:
[/Y]: Thought it probably did, always used the long way.
Steve
0
 
Pete LongTechnical ConsultantCommented:
:^)  np
0
 
Pete LongTechnical ConsultantCommented:
ty
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.