Hi, I am developing an application using vc++, in that, i have to execute shell command. I executed successfully using ShellExecute(). Now i want to know how to get the return value of that shell command, while executing mountvol like this command, it return list of drives, if I run using the above method, how can i get that return value.. can any one help me
Since you use VC++, I suggest you to use CreateProcess command since it gives you more control over the created application. If you use that you can use GetExitCodeProcess function to determine the return value. You may use following APIs for this. CreateProcess WaitForSingleObject TerminateProcess GetExitCodeProcess If you are interested in using ShellExecute, then use ShellExecuteEx which will return the process id that can be used with GetExitCodeProcess.