Hi
In our logon script I have this line of code:
I want to check for errors generally throughout the script and so have written this code:
The function 'HandleNonFatalError' is as follows:
(There is also 'HandleFatalError' which doesn't have the 'QuitOut' function call commented out).
My question is this, why doesn't the [tt]intReturn = objWSHShell.Run("zwscript.exe " & varNetLogonPath & "z" & strPlugIn, 0, FALSE)[/tt] line return any kind of error code/value even though it quite plainly has a typo in it? I've also tried typos in each of the two elements in the target path but it just never seem to produce an actual error. At 'best' it just ignores the whole routine that the objWSHShell.run code is in (even though it's got a list of files to iterate through).
JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, and so on)[/small]
In our logon script I have this line of code:
Code:
intReturn = objWSHShell.Run("zwscript.exe " & varNetLogonPath & "z" & strPlugIn, 0, FALSE)
Code:
if err <> 0 then
strCodeLine = "intReturn = objWSHShell.Run(""wscript.exe "" & varNetLogonPath & strPlugIn, 0, FALSE)" &_
vbCrLf &_
"as" & vbCrLf &_
"intReturn = objWSHShell.Run(wscript.exe " & varNetLogonPath & strPlugIn & ", 0, FALSE)"
strFriendlyError = "Unable to launch PlugIn '" & varNetLogonPath & strPlugIn & "'"
strErrResponse = HandleNonFatalError(Err.Number,Err.Source,Err.Description,strCodeLine,strFriendlyError)
err.clear
else
WriteLog(" Called PlugIn '" & strPlugIn & "' with error number '" & err & "' (zero means no error)")
end if
Code:
Function HandleNonFatalError(varErrNumber,strErrSource,strErrDescription,strCodeLine,strFriendlyError)
strErrResponse = DisplayErrorInfo(varErrNumber,strErrSource,strErrDescription,strCodeLine)
WriteLog(vbCrLf)
'QuitOut
End Function
My question is this, why doesn't the [tt]intReturn = objWSHShell.Run("zwscript.exe " & varNetLogonPath & "z" & strPlugIn, 0, FALSE)[/tt] line return any kind of error code/value even though it quite plainly has a typo in it? I've also tried typos in each of the two elements in the target path but it just never seem to produce an actual error. At 'best' it just ignores the whole routine that the objWSHShell.run code is in (even though it's got a list of files to iterate through).
JJ
[small][purple]Variables won't. Constants aren't[/purple]
There is no apostrophe in the plural of PC (or PST, or CPU, or HDD, or FDD, and so on)[/small]