Archive: how to call system command from NSIS script


how to call system command from NSIS script
Hi All

i just want to know that how do i call system command like "net use" form the NSIS script


Use the nsExec plugin and use the following:

nsExec::Exec 'net .....'

nsExec::Exec is only to call DOS application, for windows application use ExecWait or ExecShell.

Hope this helps.


That may not work as expected. People had problems using net unless they executed it with command prompt.

ReadEnvStr $R0 COMSPEC
nsExec::Exec "$R0 /C net ..."

Stu


I have used to the following :

ExecWait '"cmd.exe" /C net use V: 172.16.16.4\install\software /user:install passwd'

I currently use a batch file that is called by the installer - that way if the ip address changes, there is no need to recompile, the user just modifies the .bat file.

Both are working on versions of my installers but of course they have the dos window visible.

Fish


fishweasel, use my code.
cmd.exe is not present in Windows 9x, where it's command.com.

Stu


Thanks a lot again Afrow