nsnb
14th January 2010 20:40 UTC
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.
Anders
14th January 2010 21:04 UTC
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
820815
14th January 2010 23:52 UTC
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"'
nsnb
15th January 2010 18:03 UTC
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.