I’m trying to run a cmd command in my wince7 machine.
my code is: (for example)
STARTUPINFOW siStartupInfo;
PROCESS_INFORMATION piProcessInfo;
memset(&siStartupInfo, 0, sizeof(siStartupInfo));
memset(&piProcessInfo, 0, sizeof(piProcessInfo));
siStartupInfo.cb = sizeof(siStartupInfo);
TCHAR regsvrActiveXConsole[256] = L"cd";
if (CreateProcess(L"\\Windows\\cmd.exe", regsvrActiveXConsole ,0,0,false,NULL,0,0,&siStartupInfo, &piProcessInfo))
{
}
else
{
}
and I get: “unrecognized option cd.”
Do I miss something?
Do I need to add something to the image in order to run cmd commands?
cmdhas certain usage rules, it doesn’t just execute whatever you pass in arguments, typecmd /?in command prompt for more information. To make it execute a command, you need the/Coption. The valid invocation would be:i.e.