Skip to content
⌘ NSIS Forum Archive

how to call system command from NSIS script

6 posts

gugaliashashank#

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
darthvader#
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.
Afrow UK#
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
fishweasel#
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