Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 357
  • Last Modified:

batch file

how to write batch file to capture a printer on startup in windows 2000
0
lsbrown1
Asked:
lsbrown1
  • 4
  • 2
1 Solution
 
Pete LongTechnical 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
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
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

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now