Link to home
Start Free TrialLog in
Avatar of MarionTaylor
MarionTaylor

asked on

How to run a WScript batch file ?

I have a file with the following WScript code.  What type of file do I save it as so it will run ?



REM ** Set the Enviroment **

Dim objNetwork
Set objNetwork = CreateObject("WScript.Network")

REM ** Remove existing network printers **

objNetwork.RemovePrinterConnection "LPT1:", True

REM ** Attach the Network printers **

objNetwork.AddWindowsPrinterConnection "\\server\hp"
objNetwork.AddWindowsPrinterConnection "\\server\Generic"

REM ** Set the Default Printer **

objNetwork.SetDefaultPrinter"\\server\Generic"
ASKER CERTIFIED SOLUTION
Avatar of mdiglio
mdiglio
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial