Testing for exist codes with SMSI

Here is sample code on how to test for an exist code using SMS Installed.

 

item: Execute Program

  Pathname=%win%\notepad.exe

  Default Directory=%win%\

  Flags=00000010

end

item: If/While Statement

  Variable=PROCEXITCODE

  Value=0

end

item: Display Message

  Title English=Exit Code

  Text English=Notepad exited with a code of 0

  Flags=00100100

end

item: Else Statement

end

item: Display Message

  Title English=Exit Code

  Text English=Notepad exited with a code of 1

  Flags=00110000

end

item: End Block

end

 

Leave a Reply

Your email address will not be published. Required fields are marked *