title: Google Depot Tools `gclient runhooks` fails, "SYSTEMROOT" must be valid
body: <p>I am attempting to work on <a href="http://www.chromium.org/Home" rel="nofollow noreferrer">Chrome</a> and one of the key commands <code>gclient runhooks</code> fails with the error.</p>
  <pre><code>Exception: Environment variable &quot;SYSTEMROOT&quot; required to be set to valid path
  Error: Command C:\Users\noahh_000\Noah\Programing\Chrome\Tools\DepotTools\depot_
  tools\python276_bin\python.exe src/build/gyp_chromium returned non-zero exit sta
  tus 1 in C:\Users\noahh_000\Noah\Programing\Chrome\Chromuim
  Hook ''C:\Users\noahh_000\Noah\Programing\Chrome\Tools\DepotTools\depot_tools\py
  thon276_bin\python.exe' src/build/gyp_chromium' took 36.86 secs
  </code></pre>
  <p>It seams like the error is</p>
  <pre><code>Exception: Environment variable &quot;SYSTEMROOT&quot; required to be set to valid path
  </code></pre>
  <p>I think this means that the environment variable <code>SYSTEMROOT</code> is not defined, however when I look at my System Enviroment variables I see that <code>SYSTEMROOT</code> is indeed set</p>
  <p><img src="https://i.stack.imgur.com/Mkki3.png" alt="System Environment Vars" /></p>
  <p>I have also tried changing it to</p>
  <ul>
  <li>C:/WINDOWS</li>
  <li>C:/windows</li>
  <li>C:\WINDOWS</li>
  <li>C:\windows</li>
  <li>C:\WINDOWS</li>
  <li>C:\windows</li>
  </ul>
  <p>but none worked.<br />
  When I list the environment variables(With <code>set</code>) <code>SystemRoot</code> is defined but not <code>SYSTEMROOT</code>
  <br><br></p>
  <h2>System Info</h2>
  <p><strong>OS</strong>: <em>Windows 8</em><br />
  <strong>Architecture</strong> <em>x64</em></p>
  <p><br><br>
  <strong>Edit:</strong> I found where the script throws the exception and I made it output the paths it thinks its getting and it outputs</p>
  <pre><code>The system cannot find the path specified
  </code></pre>
  <p><br><br>
  <strong>Edit2:</strong> It looks like a file that in <code>depot_tools\win_toolchain\vs2013_files\win8sdk\bin\SetEnv.cmd</code> has an error. The python script runs the file in a subproccess and tries to get a result, but somewhere in this subproccess a file can not be found, hence the</p>
  <pre><code>    The system cannot find the path specified
  </code></pre>
  <p><a href="http://pastebin.com/dGgYyPFL" rel="nofollow noreferrer">SetEnv.cmd</a></p>