Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 602
  • Last Modified:

Script to delete, add network printer

I'm having a heck of a time getting a proper script to delete/remove then add a printer to a Windows 7 Starter client.

We have a network printer located at: \\blue\C351_PCL that's shared through a Win2k3 server.  It will require credentials... We'll say user: printer  password: printer.

Can someone help/provide me a script that will remove this existing printer then reinstall it?  I can't seem to get the PC to remember credentials... so every morning I have to manually do this.  I would put the machine on the domain but it's Win7 starter...
0
gr1z
Asked:
gr1z
  • 3
1 Solution
 
gr1zAuthor Commented:
Ok figured it out.

Remove: @Rundll32.exe printui.dll,PrintUIEntry /dn /q /n"\\blue\C451_PCL

Add: @Rundll32.exe printui.dll,PrintUIEntry /in /q /n"\\blue\C451_PCL

0
 
gr1zAuthor Commented:
Figured it out.
0
 
Tyler LaczkoCommented:
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\server\Xerox WorkCentre Pro C3545"
WshNetwork.AddWindowsPrinterConnection "\\server\Xerox WorkCentre Pro C3545 - Color"
WshNetwork.AddWindowsPrinterConnection "\\server\Xerox WorkCentre 7435"
WshNetwork.AddWindowsPrinterConnection "\\server\Xerox WorkCentre 7435 - Color"
WshNetwork.AddWindowsPrinterConnection "\\server\Phaser 5550N PS"

WshNetwork.SetDefaultPrinter "\\server\Phaser 5550N PS"

wscript.quit
0
 
gr1zAuthor Commented:
I didn't mean to close this so soon!

I still have the problem of needing credentials supplied when connecting to the printer.

I guess I will re-post a similar question if all else fails.
0

Featured Post

Who's Defending Your Organization from Threats?

Protecting against advanced threats requires an IT dream team – a well-oiled machine of people and solutions working together to defend your organization. Download our resource kit today to learn more about the tools you need to build you IT Dream Team!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now