Opening a batch file from a C program under WinCE

Is it possible to open a batch file using a C program under WinCE? I’ve tried using CreateProcess, but nothing happens when that line of code is reached. Is this possible?


You can run cmd.exe with reate process and provide your batch file as a paramter, that should do the job.

Here’s a solution that worked for me.

TCHAR cpExecutable[256] = L"\\Windows\\cmd.exe";
TCHAR cpCommandLine[256] = L"/C \\FlashDisk\\Thermostat\\Thermostat.bat";
STARTUPINFOW siStartupInfo; 
memset(&siStartupInfo, 0, sizeof(siStartupInfo)); 
memset(&piProcessInfo, 0, sizeof(piProcessInfo)); 
siStartupInfo.cb = sizeof(siStartupInfo);

CreateProcess(cpExecutable, cpCommandLine, 0, 0, FALSE, NULL, 0, 0, &siStartupInfo, &piProcessInfo);

@sbickle99 thank you very much for sharing this.