title: Run Windows PhotoViewer on image file with spaces in its path
body: <p>I have a problem with running PhotoViewer on image file with spaces in its path.</p>
  
  <p>I'm using C++ function CreateProcess, supplying a command line as its argument. The command line template for that is:</p>
  
  <pre><code>"rundll32 &lt;path to PhotoViewer.dll&gt; ImageView_Fullscreen &lt;path to image&gt; "
  e.g.
  "rundll32 \"C:\\Program Files\\Windows Photo Viewer\\PhotoViewer.dll\" ImageView_Fullscreen Z:\\Documents\\Projects\\ScreenCapture1\\ScreenCapture\\ScreenCapture\\sample.bmp"
  </code></pre>
  
  <p>The problem here is the fact that  must be without double quotes and  cannot contain spaces.</p>
  
  <p>My code is more or less like this</p>
  
  <pre><code>_tcscpy_s( str, 200, _T("rundll32 \"C:\\Program Files\\Windows Photo Viewer\\PhotoViewer.dll\" ImageView_Fullscreen Z:\\Documents\\Projects\\ScreenCapture1\\ScreenCapture\\ScreenCapture\\sample.bmp") );
  CreateProcess( NULL,            // No module name (use command line). 
          str,            // Command line. 
          NULL,           // Process handle not inheritable. 
          NULL,           // Thread handle not inheritable. 
          FALSE,          // Set handle inheritance to FALSE. 
          0,              // No creation flags. 
          NULL,           // Use parent's environment block. 
          NULL,           // Use parent's starting directory. 
          &amp;si,            // Pointer to STARTUPINFO structure.
          &amp;pi );          // Pointer to PROCESS_INFORMATION structure.
  
  HANDLE hProcess = pi.hProcess;
  CloseHandle(hProcess);
  </code></pre>
  
  <p>Now I want to run PhotoViewer on an image file with spaces on its path, for example </p>
  
  <pre><code>C:\the folder\has spaces\the image file.bmp
  </code></pre>