Archive: Executing dos command


Executing dos command
is there a way to execute dos command?
like for installing services: <service name> /install
or for adding registry: reg add HKEY_CURRENT_USER\... /v <app name> /t REG_SZ /d <path>


When I google 'NSIS dos command', the third hit gives everything you need... Next time, please bother searching for the answer before asking.

However, I fail to understand how dos commands relate to services and/or registry. NSIS has a big list of registry functions that you can use (see the manual). Services can be installed with a plugin. Again, google is your friend.


sorry may be i search with the wrong keyword.
and yes there a plugin related to services and registry.
for the registry it work fine with me(the problem was on windows UAC. when i turn it off, my application work fine).
but for the services, i try using plugins to install my services. it can install my services but my services cannot run, stopped, or uninstalled even with UAC turned off. when i work on my services application, i install it manualy to test it using dos command and it can start, stop and being uninstalled.
i don't know what is going wrong, so i try to use dos command.


You probably need admin access in your installer. Add 'requestexecutionlevel admin' and use the UserInfo plugin in .onInit to verify that you got admin access (and throw an error and quit if you didn't).


Originally posted by MSG
Services can be installed with a plugin.
This is not always true, I have dealt with several services that had to be self registered by use of a command line switch or they would not operate correctly (do not know if that is his issue or not).

But to answer the question have a look at ExecWait in some cases I have had to use nsexec::exec or nsexec::exectostack.