Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Exec" into specific folder

Tags:

nsis

From an NSIS script (located at C:\nsis\ for example), I execute an external program (let's say something.bat) with some paramerters:

Exec '"Z:\draft\something.bat" $param1 $param2'

something.bat is suppoed to rename the directory C:\nsis. My question is, how can I tell Exec to launch something.bat inside Z:\draft\ and not C:\nsis\? Because, it can't rename the directory otherwise.

Thanks.

like image 835
Anonymous Avatar asked Jun 16 '26 19:06

Anonymous


1 Answers

You can use SetOutPath to set the current working directory. I think that should do what you want.

In the NSIS documentation you can also see that it uses the variable that SetOutPath sets (which is $OUTDIR) for Exec statements.

4.9.1.2 Exec

Exec command
Execute the specified program and continue immediately. Note that the file specified must exist on the target system, not the compiling system. $OUTDIR is used for the working directory.

like image 160
Brian R. Bondy Avatar answered Jun 20 '26 00:06

Brian R. Bondy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!