/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Trying to delete a network printer and add a new network printer on a new print server.

09/25/2015 720 views

Our company has upgraded and made new print servers for each branch.  I am new to scripting and would like to ask how I can remove an old printer and add a new one.  I am currently looking to use a batch file.  I am currently have a script but would like to add the step to remove the old one.  I don't want to confuse the users while printing.  Below is my batch file.  Please let me know what I can do to make it work the best. I also am trying to not have the users not reboot to see the newly added printer.

 

REM Add printer
rundll32 printui.dll,PrintUIEntry /ga /n\\"Print Server Name"\"Printer Name"
md.exe /c start /wait ping 127.0.0.1 -n 10
cd c:\windows\system32
NET stop spooler
NET start spooler

 

 

1 Comment   [ + ] Show comment

Comments

  • Thanks, anyone have a script that has an IF THEN statements. If \\server1\Printer1 then run command line to delete that printer and install the new one \\Server\NY-print-01

All Answers

0
Seek out the rather nice print-related VBS scripts from Microsoft. Much more flexible than nasty old batch!

Google for 'prncnfg.vbs' - that should turn the whole set up.
Answered 09/30/2015 by: VBScab
Red Belt

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ