Script to execute a bat
I suck at scripting... but I need a script to execute a .bat file after extracting everything. Can anyone help me?
Archive: Script to execute a bat
Script to execute a bat
I suck at scripting... but I need a script to execute a .bat file after extracting everything. Can anyone help me?
Just use Exec or ExecShell in a section or function.
To hide DOS window use nsExec (nsis\contrib\nsexec) or ExecDos. Anders' remark in the ExecDos thread about bat files execution is important.
Thanks!
Is there a way to make sure that the files get extracted in a precice folder? Because the paths in the .bat needs it.
Use SetOutPath first.
..or..
for single files you can use:
File "/oname=$INSTDIR\file.ext" "localfile.ext"
-Stu
One last thing... how can I make this work?
ExecShell "at 00:00 /every:Su,M,T,W,Th,F,S "cd $INSTDIR | .\update.bat""
The ExecShell command is used to execute Windows shell commands, which appear in the "right-click" menu--things such as "open", "print", etc.
So, to run a batch file, it would be something like this:
ExecShell "open" "C:\path\update.bat"
Thank you very much!
Well, 'at' is a command-line executable so you just need to call it with %COMSPEC%:
ReadEnvStr $R0 COMSPEC
nsExec::Exec '"$R0" /C at 00:00 /every:Su,M,T,W,Th,F,S "cd $INSTDIR | .\update.bat"'
I used the Scheduled Task plugin :)