title: grep: input file ">":System cannot find the file specified
body: <p>when I tried to execute a grep command in c++, I got the following error:
  grep: Input file: ">":System cannot find the file specified</p>
  
  <p>Can anyone help me to resolve this?</p>
  
  <pre><code>         wchar_t* grepArg= L"\"D:\\grep\" -f \"C:\\Users\\ic014733\\AppData\\Local\\Temp\\patterns.tmp\" \"D:\\LOG2014_10_05.LOG\" &gt;\"D:\\share\\result.txt\"";
  
          if ( !CreateProcessW(NULL, grepArg, NULL, NULL, FALSE, 0, NULL, NULL, &amp;si, &amp;pi) )
          {
              DWORD errorMessageID = ::GetLastError();
  
          }
          else 
          {
              DWORD res = WaitForSingleObject(pi.hProcess, INFINITE);
              TerminateProcess(pi.hProcess, 0);                   
              PostThreadMessage(pi.dwThreadId, WM_QUIT, 0, 0) ;
  
              CloseHandle(pi.hProcess);
              CloseHandle(pi.hThread);
  
          }
  </code></pre>