Home All Groups Group Topic Archive Search About

connect to the shared printer when start-up

Author
8 Apr 2005 1:26 AM
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.

Author
8 Apr 2005 4:07 AM
Nick Staff
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

Show quoteHide quote
"Kang" wrote:

> 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.
>
>
>
Author
8 Apr 2005 4:29 AM
Nick Staff
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

Show quoteHide quote
"Nick Staff" wrote:

> 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
>
> "Kang" wrote:
>
> > 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.
> >
> >
> >