Question

Locked

Script to map shared printer

By v_2chpin ·
Hello,
I have a printer installed on a Win 2003 server which is acting as a file and print server. The client machines are in a workgroup as of now and the printer is shared out and mapped to all of them. Almost everyday the printer looses its connection and has to be remapped on most of the client machines. The clients are running Win XP SP2.

I was wondering if anyone can help me with a script which I can keep on the users' desktops as a cmd or a bat file and have the users run it to map the printer whenever they face this problem. I found a couple of scripts on the internet but none of them worked for me. Any help is greatly appreciated.

Chandra

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

script

by ben.rattigan In reply to Script to map shared prin ...

Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\<servername>\<printersharename>", "<printer_description>"
wshShell.Run "net use lpt1: \\<servername>\<printersharename>"
WSCript.Quit

Back to Networks Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums