I've written following function:
code:
Function KillMyProcess
; Change current directory to temp
; to prevent creation of TempWmicBatchFile.bat
Push $OUTDIR
StrCpy $OUTDIR $TEMP
nsexec::ExecToLog "wmic process where name='MyApp.exe' delete"
Pop $OUTDIR
FunctionEnd
As far as I know $OUTDIR should not change after this function is called, but it equals to 0 instead. I tried to add debug message boxes. Looks like everything goes fine until Pop is called which just sets $OUTDIR value to zero. Why is that?