Hi,
Thanks for all who actively discussed on this thread.
I have changed part of the code
Code:
if(!CreateProcess(NULL, cmd, NULL, NULL, FALSE, flag,
NULL, NULL, &si, &pi)) {
err = GetLastError();
LogMsg(3, "RunCommand: Could not create process %s error=%d", cmd, err);
return;
}
To
Code:
CreateProcess(NULL, cmd, NULL, NULL, FALSE, flag,NULL, NULL, &si, &pi);
err = GetLastError();
LogMsg(3, "RunCommand: Could not create process %s error=%d", cmd, err);
Then I got the message “RunCommand: Could not create process subst R: "C:\Program Files\Syntegra" error=183”
I used
Code:
ShellExecute(NULL, NULL, "subst.exe", "R: C:\PROGRA~1\Syntegra", NULL, SW_HIDE );
And also used
Code:
DefineDosDevice(0, “R:”, “C:\\PROGRA~1\\Syntegra”);
For all I am getting the same error 183(ERROR_ALREADY_EXISTS).
But I am not seeing any R: drive in my “MyComputer” or start->run>r: also states no drive found.
I also tried using the below code.
Code:
STARTUPINFO si = { 0 };
PROCESS_INFORMATION pi = { 0 };
Now my only question is how I am getting err 183, even though I am not able to see the drive R: in “MyComputer”. Interestingly I can use “subst” directly in command prompt and I am successful in viewing the dive R: in “MyComputer”.
Regards,
Naga