Keep Shellexecuteexw's Command Prompt Opened
I'm Trying to Use Shellexecuteexw to Run a Bat File. I Want the Command Prompt to Be Kept Opened After the Bat File Has Been Executed. Here's What I Tried...
I'm trying to use ShellExecuteExW to run a bat file.
I want the command prompt to be kept opened after the bat file has been executed.
Here's what I tried,
SHELLEXECUTEINFOW TempInfo = { 0 };
TempInfo.cbSize = sizeof(SHELLEXECUTEINFOA);
TempInfo.fMask = 0;
TempInfo.hwnd = NULL;
TempInfo.lpVerb = L"runas";
TempInfo.lpFile = L"cmd.exe";
TempInfo.lpParameters = L"\\k runMe.bat StartTool";
TempInfo.lpDirectory = NULL;
TempInfo.nShow = SW_NORMAL;
::ShellExecuteExW(&TempInfo);
But what I see is my cmd.exe stays opened but it didn't actually ran my runMe.bat file.
1 Answer
@dewaffled answered it... /k instead of \\k