How to run a WScript batch file ?

Posted on 2006-05-23
Last Modified: 2013-12-03
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 **

Question by:MarionTaylor
    1 Comment
    LVL 16

    Accepted Solution

    You'll want to save this with a .vbs extension.
    This is a Visual Basic Script

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now