Jump to content

Detecting Ghost32.exe errorlevel


Recommended Posts

Hi,

I am trying to figure out how to catch errors thrown by Ghost32.exe. In CMD ghost32 will return and set the ERRORLEVEL variable to 0 if successful.

My script has this:

Func Ghost($pImagePath, $pDestination, $pPathToGhostFiles )
    RunWait($pPathToGhostFiles & "ghost32.exe -clone,mode=prestore,src=" & $pImagePath & ":1,dst=" & $pDestination & " -sure")
EndFunc

In a batch file, I would do something like this:

IF ERRORLEVEL 1 (ECHO --- !!!There was a Problem and Ghost did not finish imaging!!!
COLOR 4f) ELSE (ECHO --- Ghosting Complete
COLOR 2F)

Can anyone help?? I found one related post, but couldn't make any sense of it.

Thanks,

Josh

Link to comment
Share on other sites

RunWait retruns the %errorlevel%

Func Ghost($pImagePath, $pDestination, $pPathToGhostFiles )
$ErrorLevel = RunWait($pPathToGhostFiles & "ghost32.exe -clone,mode=prestore,src=" & $pImagePath & ":1,dst=" & $pDestination & " -sure")
;Msgbox(0,"Ghost Errolevel", "Error: " & $Errorlevel)
Return $Errorlevel
EndFunc
Link to comment
Share on other sites

RunWait retruns the %errorlevel%

Func Ghost($pImagePath, $pDestination, $pPathToGhostFiles )
$ErrorLevel = RunWait($pPathToGhostFiles & "ghost32.exe -clone,mode=prestore,src=" & $pImagePath & ":1,dst=" & $pDestination & " -sure")
;Msgbox(0,"Ghost Errolevel", "Error: " & $Errorlevel)
Return $Errorlevel
EndFunc

Thanks! I am so stupid!
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...