Sign in to follow this  
Followers 0
ltjKt1

Detecting Ghost32.exe errorlevel

3 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
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
Sign in to follow this  
Followers 0