Re: Error in vbscript
- From: "Mark D. MacLachlan" <markdmac@xxxxxxxx>
- Date: Wed, 01 Jul 2009 10:19:20 -0700
Joan wrote:
Hello,
I have an error in a script in the session of user, and I would like
to know because, for that reason I want to show in screen the error,
in this case it is due to an error of printer name.
This is the it lines of the code
Case Else
WSHNetwork.AddWindowsPrinterConnection "\\ESMAFAP10" +
ServidorImpresion + ".AMIC.NET\" + Right (object.cn,10) + "$"
Is correct this?
WScript.Echo "Printer = " & WSHNetwork.AddWindowsPrinterConnection
"\\nameserver" + printserver + ".dominio.NET\" + Right (object.cn,5)
+ "$"
Thanks
[code]
Dim WSHNetwork
Set WSHNetwork = CreateObject("Wscript.Network")
printer = "\\nameserver" & printserver & ".dominio.NET\" & Right
(object.cn,5) & "$"
On Error Resume Next
WSHNetwork.AddWindowsPrinterConnection printer
If Err.Number <> 0 Then
WScript.Echo "Cannot map to printer:" & printer
End If
[/code]
Hope that helps.
Regards,
Mark D. MacLachlan
--
.
- Prev by Date: Re: Look over this script.....could anything be done better?
- Next by Date: Re: newbie Help: HOW to use VBSCript on clientside to detect browser type and version
- Previous by thread: Re: Look over this script.....could anything be done better?
- Next by thread: MsgBox "Hi", 6858
- Index(es):
Relevant Pages
|