Archive: nsExec::Exec doesn't wait. What could be there reasons?


nsExec::Exec doesn't wait. What could be there reasons?
This code, using ExecWait, runs and waits perfectly:

ExecWait'"$INSTDIR\\myf.exe""$INPVAR""$R0\\custdir\\infile.txt""$R0\\custdir\\outfile.html"'

But the following code, using nsExec::Exec, runs but doesn't wait:
ReadEnvStr$VARCOMSPECCOMSPEC

nsExec
::Exec'"$VARCOMSPEC"/C"$INSTDIR\\myf.exe""$INPVAR""$R0\\custdir\\infile.txt""$R0\\custdir\\outfile.html"'
At first I thought that this is by design, but I searched this forum and found found various threads which suggest that nsExec::Exec should wait.

myf.exe is a win32 console application. $R0 contains a folder path.

What could possibly explain what I am experiencing? What am I missing in using nsExec::Exec correctly?

Thanks.

why use comspec?

anyways, cmd.exe is stupid when it comes to quotes, sometimes it helps to execute it as: cmd.exe if 1==1 yourcommandhere


Re: nsExec::Exec doesn't wait. What could be there reasons?

nsExec::Exec'"$VARCOMSPEC"/cstart/wait/b"$INSTDIR\\myf.exe""$INPVAR""$R0\\custdir\\infile.txt""$R0\\custdir\\outfile.html"'


Originally posted by 820815
nsExec::Exec'"$VARCOMSPEC"/cstart/wait/b...'

Sorry, this doesn't work.

Originally posted by Anders
why use comspec?
To have the option of using redirection.

Originally posted by Anders
anyways, cmd.exe is stupid when it comes to quotes, sometimes it helps to execute it as: cmd.exe if 1==1 yourcommandhere
Thank you! That solved the problem. It works perfectly.