Skip to content
⌘ NSIS Forum Archive

how to execute Batch background?

7 posts

ladderliu#

how to execute Batch background?

hi all,i am a newbie in NSIS.i want to exec a Batch file(such as a java ant command) background,let the cmd window minimize.how to do it in NSIS?
thanks
deguix#
ExecShell "open" "program.exe" "" "SW_SHOWMINIMIZED" 
Replace "program.exe" with your program file name.

OR

If want the details about the operation to appear when installing (but not its window), you can use the plugin nsExec:

nsExec::Exec "program.exe" 
ladderliu#
thank you.
i use
Execwait '$INSTDIR\loannewetna.bat $INSTDIR\build upgrade.xml $INSTDIR\loadresult.txt'
in my .nsi file,it works.
but when i use :
ExecShell "open" "$INSTDIR\loannewetna.bat" "$INSTDIR\build upgrade.xml $INSTDIR\loadresult.txt" "SW_SHOWMINIMIZED"
nothing happens.
here $INSTDIR\build upgrade.xml $INSTDIR\loadresult.txt are parameters to this batch.can you tell me why?
best regards
ladderliu#
en ,i use nsExec::Exec like this ,also nothing happens
nsExec::Exec "$INSTDIR\bin\upgrade.bat loadGenerationXMLData" 
can you tell me the difference between nsExec::Exec,Execwait and ExecShell.
thanks again🙂
Dj Nyx#
this should work... [if the path is correct]
nsExec::Exec '"$INSTDIR\bin\upgrade.bat" loadGenerationXMLData'