title: How can I escape spaces in a path to file I'm passing to PHP-cli (on Windows)
body: <p>Let me start by saying just how much I truly hate PHP on Windows. </p>
  
  <p>With that out of the way, all I'm trying to do is pass a file to PHP, because the PHP msi installer didnt work (clearly they dont care too much about PHP working on windows either), I've just used the zipped files. </p>
  
  <p>I have a file which needs to be passed into php, and two parameters which need to be passed to the file, so i launch my script like this from cmd:</p>
  
  <pre><code>c:\php\php.exe c:\my_location\Myscript.php t:\test AF7
  </code></pre>
  
  <p>The above works just fine (after a lot of messing about), the last two parameters are passed to the PHP script and can handle spaces if they are escaped by double quotes and I use escapeshellarg() within the script.</p>
  
  <p>However someone has decided to install my script itself in a path containing spaces and I have no idea how to get round it:</p>
  
  <p>e.g if I tried:</p>
  
  <pre><code>c:\php\php.exe "c:\my location\myscript.php" t:\test AF7
  </code></pre>
  
  <p>It comes back with the error "Could not open input file: C:\my"</p>
  
  <p>Note: I've also tried escaping with a '^' but this doesnt seem to work either</p>
  
  <p>Here is the layout of my script for clarity:</p>
  
  <pre><code>Class Myscript 
  {
      public static function convert($classfile, $par1, $par2)
      {
          //code here
      }
  }
  call_user_func_array(array('Myscript', 'convert'), $argv);
  </code></pre>
  
  <p>How can I handle this correctly, you're help is greatly appreciated.</p>