Jump to content

VBScript -> AutoIT Error Handling Help


Recommended Posts

You were not specific about what "command you passed to the host OS" meant. This was the simple example I was talking about:

$iRET = RunWait(@ComSpec & ' /c DIR "C:\NoSuchDir"')
ConsoleWrite("$iRET = " & $iRET & @LF)

It returns 1 because DIR on a non-existing directory returns %ERRORLEVEL% = 1 to the shell.

If you meant a call to a COM object, then you want COM/OBJ Reference in the help file, with attention to COM Error Handlers.

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You were not specific about what "command you passed to the host OS" meant. This was the simple example I was talking about:

$iRET = RunWait(@ComSpec & ' /c DIR "C:\NoSuchDir"')
ConsoleWrite("$iRET = " & $iRET & @LF)

It returns 1 because DIR on a non-existing directory returns %ERRORLEVEL% = 1 to the shell.

If you meant a call to a COM object, then you want COM/OBJ Reference in the help file, with attention to COM Error Handlers.

;)

right and i understand that typically functions return 0 on success, 1 on failure. what i was looking for was something equivalent to the vbscript err object. where:

if @error then

msgbox(0,"Error Occurred", err.description);

endif

...so if you pass a path to the run or exec command and the path isn't valid, err.description would report back "invalid path" or "path not found".

this may be strictly a vbscript available object but that's what i was looking for.

:)

Edited by thepip3r

My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...