I have a command,I need to execute the same using C Program. I have stored the entire command ,with arguments, in the variable cmdline. When I am using system(cmdline),it is working fine. But on using the following: ret = CreateProcess(NULL, cmdline, (LPSECURITY_ATTRIBUTES)NULL, (LPSECURITY_ATTRIBUTES)NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, &startup, &pinfo);
I am getting the return code as 2 in GetLastError().
Can somebody tell the reason? Thanks in advance.