Re: Error in vbscript

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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

--

.



Relevant Pages

  • Re: (un)Wisdom of overwriting $_POST?
    ... much data into session, although I am not sure there's any problem ... I see no reason to copy it into one more variable, ...  If authentication has expired, and the user ... re-authorizes on another script, obviously I've lost $_POST. ...
    (comp.lang.php)
  • Re: Error in vbscript
    ... I have an error in a script in the session of user, ... because, for that reason I want to show in screen the error, in this case ... To concatenate strings you should use &, ...
    (microsoft.public.scripting.vbscript)
  • Re: Error in vbscript
    ... 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 ... You have not provided enough information for us to guess if any of this is correct or not, however, you are referencing the addwindowsprinterconnection method as if it would return a value as if it were a function, but without enclosing its parameters in parentheses. ...
    (microsoft.public.scripting.vbscript)
  • Re: stupid IE7 question
    ... closer look on session handling. ... Obscure methods like hiding an URI always ... rewrites itself to another script of yours with the session key as the ... I am currently testing a proprietary secure web based ...
    (Pen-Test)
  • Re: (Sloppy correction) Re: session management with database: optimal parameters in php.ini
    ... looking then another script read N! ... make it so simple that there are obviously no deficiencies, ... but I never used their db session management ... I avoid MySQL since I consider it an inferior db. ...
    (alt.php)