connect to the shared printer when start-up

  • Thread starter Thread starter Kang
  • Start date Start date
K

Kang

I want to connect to the share printer when I start up.
I put a batch file into the start up folder so it runs every time the system
boots.
For example, the server IP is 10.10.10.10 and the name of shared printer is
"shared_printer", then how can make the batch file?

Thanks.
 
Kang-

Open up notepad and type this in:

start wscript.exe c:\prinstall.vbs
exit

Save the file as "C:\prinstall.bat" (use the quotes)

Open a new notepad and type this in:

Set WshNetwork = CreateObject("WScript.Network")

WshNetwork.AddWindowsPrinterConnection "\\10.10.10.10 \shared_printer"
WshNetwork.SetDefaultPrinter "\\10.10.10.10 \shared_printer"

wscript.quit

Save the file as "c:\prinstall.vbs" (with the quotes)

Create a shortcut to C:\prinstall.bat and put it in your startup folder

If you have any problems please let me know, otherwise enjoy!

Nick
 
Please note that the script should contain 4 lines (due to formatting it may
have posted otherwise).

The lines should begin:

Set WshNetwork
WshNetwork
WshNetwork
wscript.quit

thanks
 
Back
Top