Sign in with
Sign up | Sign in
Your question

connect to the shared printer when start-up

Last response: in Windows 2000/NT
Share
April 8, 2005 2:26:14 PM

Archived from groups: microsoft.public.win2000.general (More info?)

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.
Anonymous
April 8, 2005 2:26:15 PM

Archived from groups: microsoft.public.win2000.general (More info?)

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.
>
>
>
Anonymous
April 8, 2005 2:26:16 PM

Archived from groups: microsoft.public.win2000.general (More info?)

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

"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.
> >
> >
> >
Related resources
May 3, 2012 3:18:32 PM

Dear,

I did the same as mentioned, but i am getting an error popping Line: 2 Char: 1.

Please do suggest on the same.

With regards,

J Arvind Amarnath
May 3, 2012 6:16:48 PM

If you connect to the shared printer once, it will save it in your profile, just do it manually. Or use this command

rundll32 printui.dll,PrintUIEntry /ga /n\\server\printershare

That sets up a "machine" connection to the printer so all users that logon will have that printer installed.
!