Archive: Capture output of a command


Capture output of a command
How to capture a output of a command to a variable,say i need to capture the output of a command sc.exe.


nsExec

but you should not use sc.exe to modify services, see http://nsis.sourceforge.net/How_do_I...heck_a_service


I am not going to modify the service i just want to get the information of a service say sc.exe qc Apache2.2 will give the configuration information of it and from it i want to grep the BINARY_PATH_NAME alone,so nsExec::Exec 'sc.exe qc apache' will just run the command for me ,how to get the output in to a variable ,i am a newbie to NSIS plz help me.


I got it nsExec::ExecToStack works fine,Thanks Anders for your help.


Did you even check the links? using SC.exe is not the best way to do this