Is your server running slowly? Check with SolarWinds ipMonitor
Get a free evaluation copy of ipMonitor
Contents for Out-Takes 69 Option Explicit
Instructions
- Prerequisite you need to substitute your printer share for \\ Alan\HP6
- I assume that your client is later than Windows 98.
- Copy and paste the script below into notepad.
- Save the file with .vbs extension e.g. GuyPrinter.vbs
- Double click and then check the message box.
-
Examine your Printers and Faxes folder for a new printer.
' GuyPrinter.vbs ' Author Guy Thomas http://computerperformance.co.uk ' Version 1.2 - April 3rd 2005 ' ----------------------------------------' ' ' Purpose of script to map a
network printer ' ****************************** Option Explicit Dim objNetwork, strPrinterPath2 strPrinterPath = "\\Alan\HP6" Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strPrinterPath WScript.Echo "Connected Printer: " & strPrinterPath WScript.Quit
' End of example VBScript
' GuyPrinter.vbs ' Author Guy Thomas http://computerperformance.co.uk ' Version 1.2 - April 3rd 2005 ' ----------------------------------------' ' ' Purpose of script to map a
network printer ' ****************************** Option Explicit Dim objNetwork, strPrinterPath strPrinterPath = "\\Alan\HP6" Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection, strPrinterPath WScript.Echo "Connected Printer: " & strPrinterPath WScript.Quit ' End of example VBScript
Answer 1 Option Explicit
Declare the variable strPrinterPath not strPrinterPath2 Answer 2 No Comma
objNetwork.AddWindowsPrinterConnection, strPrinterPath
' GuyPrinter.vbs ' Author Guy Thomas http://computerperformance.co.uk ' Version 1.2 - April 3rd 2005 ' ----------------------------------------' ' ' Purpose of script to map a
network printer ' ****************************** Option Explicit Dim objNetwork, strPrinterPath strPrinterPath = "\\Alan\HP6" Set objNetwork = CreateObject("WScript.Network")
objNetwork.AddWindowsPrinterConnection strPrinterPath WScript.Echo "Connected Printer: " & strPrinterPath WScript.Quit
' End of example VBScript
[ezine/Affiliates/Computer-Training/index.htm] |