title: CreateProcess fails under windows 7
body: <p>I'm trying to compile legacy code from Windows XP under a new environment in Windows 7. It compiles but fails at runtime.</p>
  
  <p>CreateProcess() returns 0 and GetLastError() returns 2, which stands for ERROR_FILE_NOT_FOUND</p>
  
  <p>Here is my call to CreateProcess</p>
  
  <pre><code>STARTUPINFO StartInfo;
  memset(&amp;StartInfo, 0, sizeof(StartInfo));
  
  wcsncpy(astrCommandLine, L"TFTP", MAX_OSCOMMANDLINE_SZ-1); 
  BOOL bFuncRetn = CreateProcess(NULL, 
                astrCommandLine,     // command line 
                NULL,          // process security attributes 
                NULL,          // primary thread security attributes 
                NULL,          // handles are inherited 
                0,             // creation flags 
                NULL,          // use parent's environment 
                NULL,          // use parent's current directory 
                &amp;StartInfo,          // STARTUPINFO pointer 
                &amp;m_ProcInfo );   // receives PROCESS_INFORMATION 
  </code></pre>
  
  <p>Now for the oddities : When instead of tftp I run calc, calc pops up. I can execute whatever is on my command line from anywhere in a command prompt so it tells me that the %PATH% to c:\windows\system32 is known and works correctly.</p>
  
  <p>I tried to force CreateProcessA with ansi strings but I got the same result. I also tried in debug and release configuration and from command line.</p>
  
  <p>Any idea?</p>
  
  <p>EDIT :
  both calc.exe and tftp.exe are located in c:\windows\system32 which is in the system path.<br>
  running "c:\windows\system32\tftp" does not work</p>