Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WSH - How to get return ( TRUE OR FALSE )

Status
Not open for further replies.

clear88

Programmer
Nov 29, 2001
24
CN
Hi there,

I am using the script to set the default printer. Now I would like to check if is be set TRUR or FALSE, If so(TRUE) then prompt a msg.
----------------------------------------------
Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\CN-SHAPRT001\SHAP011"
'WshNetwork.AddWindowsPrinterConnection PrinterPath
WshNetwork.SetDefaultPrinter PrinterPath
-----------------------------------------------

Can you tell me how to do this?

Cheers
 
clear88,


Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\CN-SHAPRT001\SHAP011"
'WshNetwork.AddWindowsPrinterConnection PrinterPath
On Error Resume Next
WshNetwork.SetDefaultPrinter PrinterPath
If err.number <> 0 then
msgbox err.number & &quot;, &quot; & err.description
Else
msgbox &quot;Printer Set&quot;
End If


fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top