Skip to content
⌘ NSIS Forum Archive

how can i log the result of the exe file

4 posts

gracesync#

how can i log the result of the exe file

i have an exe file that returns "0" or "1" after executing it, how do i log this result and if its 1 will execute another command?
(i.e. if the result of the exe file is 1, i need to execute netsh add firewall).
thank you for your help
goldy1064#

Function MyFunction
ExecWait `"mybinary.exe" -aparam` $0
IntCmp $0 0 done
#do additional running
done:
FunctionEnd
gracesync#
thanks..
So the #do additional running ---this is where i execute the netsh add firewall command right?
Afrow UK#
Yes.

Also, if you wish to hide your executable, use nsExec::Exec followed by Pop $0 to get the exit code.

Stu