pixelhead
7th August 2013 21:27 UTC
execdos::exec with .bat really slow
Hi -
I've got ExecDos::exec working correctly for me but it is running extremely slow. The .bat file runs quickly through a command prompt (~1sec) but via ExecDos it takes ~1min or more.
ExpandEnvStrings $0 %COMSPEC%
ExecDos::exec /NOUNLOAD /TOSTACK '"$0" /C "$\"$INSTDIR\bin\mybat.bat$\" ${SERVER}"' "" ""
The .bat file uses JScript to run an .exe which has DLLs installed in the INSTDIR. I'm using Win7. Appreciate any hints on how to troubleshoot this.
PS: I've also created a dummy .bat file that does a simple echo and it too takes a very long time.
Thanks.
Anders
8th August 2013 02:07 UTC
Is it slow with ExecWait or nsExec?
pixelhead
8th August 2013 20:21 UTC
Hi Anders -
ExecWait works fast, except it opens a command window. From the docs, it seems I can't get the output?
nsExec is slow, like ExecDos.
Anders
9th August 2013 15:42 UTC
Does this machine have antivirus installed?
LoRd_MuldeR
9th August 2013 19:40 UTC
@pixelhead:
1) Do you get a large delay before your batch file (or whatever program it calls) is started or is it really hang while the batch file (or program) is running?
2) In the latter case: Does your batch file (or whatever program it calls) generate a whole lot of console output? Something like progress indicator which is updated frequently also means there is a lot of output! If so, try suppressing the text output.
3) Do you really need the batch file? If I understand correctly, in the end it will call JScript, so why not run JScript with the required parameters directly? Or even call the EXE file directly?
4) I second Anders' request to check the Antivirus program. Some Antivirus program can delay the start of programs or the loading of DLL's in an unacceptable way...