The code below is in a *.vbs file. I'm running the same code in WXP, W2K, and W98. It works in WXP and W2K, but not in W98. I run this code via a batch file designed to capture the exit code:
Dim WshShell, OSVer, objIE, objShell, fso, oArgs, temp1
'Set oArgs = WScript.Arguments
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("Shell.Application")
Const num1 = 1
Const num2 = 2
If num1 >= num2 Then
MsgBox("WScript.Quit(8)")
WScript.Quit(1)
Else
MsgBox("WScript.Quit(2)")
WScript.Quit(2)
End If
In W98, the batch file ALWAYS captures exit code 0 for some reason. I tried debugging using my advanced method of putting message boxes in the code... it appears to still be running ALL the code. I tried looking on MSDN and searching this site but I've been unable to find anything thus far. Any help would be greatly appreciated.
~RJ
Link to WScript on MSDN
************
RudeJohn
************
Dim WshShell, OSVer, objIE, objShell, fso, oArgs, temp1
'Set oArgs = WScript.Arguments
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("Shell.Application")
Const num1 = 1
Const num2 = 2
If num1 >= num2 Then
MsgBox("WScript.Quit(8)")
WScript.Quit(1)
Else
MsgBox("WScript.Quit(2)")
WScript.Quit(2)
End If
In W98, the batch file ALWAYS captures exit code 0 for some reason. I tried debugging using my advanced method of putting message boxes in the code... it appears to still be running ALL the code. I tried looking on MSDN and searching this site but I've been unable to find anything thus far. Any help would be greatly appreciated.
~RJ
Link to WScript on MSDN
************
RudeJohn
************