' This line removes the specified printer. ' WshNetwork.SetDefaultPrinter $newPrinter ' This line sets the user's default printer. WshNetwork.AddWindowsPrinterConnection newPrinter ' This line will add the specified printer. Set WshNetwork = CreateObject("WScript.Network") WScript.Echo "Printer conversion is now complete" If UCase(colprinters.Item (i + 1)) = " \\OLDSVR\OLDPRINT2" Then If UCase(colprinters.Item (i + 1)) = " \\OLDSVR\OLDPRINT1" Then Set colPrinters = objNetwork.EnumPrinterConnections
Set objNetwork = WScript.CreateObject("WScript.Network") ' and scan for the ones we need to change. ' Get a list of currently connected printers ' This ensures we only use variables that we ' Declaring variables - Declare everything! ' Comment: Edit this file as neccessary, before making available to users. Put the script in a network location accessible to the users and have them run it.
VBSCRIPT PRINT TO STANDARD CODE
The original code did not have to change the printer name just the server name.įeel free to use and alter this code but i can not be responsible for any damage done or problems created by it. This is alittle cumbersome if you have a lot of printers. Then for each printer pair that you need to migrate. It has not been tested but should work or at least give you a starting point. I altered it to meet your needs of changing the printer name on the new server. Here is a script that I have used in the past to migrrate users printers.