title: bcdedit file output doesn't work but other commands do
body: <p>I'm having a very strange issue with executing a command line. The code below works without a problem:</p>
  <pre><code>ShellExecute(NULL, &quot;open&quot;, &quot;cmd.exe&quot;, &quot;/C ipconfig &gt; file_output.txt&quot;, NULL, SW_SHOWNORMAL);
  </code></pre>
  <p>When executed, the ipconfig output is written to file_output.txt&quot;, which is exactly what I want. However when I use bcdedit:</p>
  <pre><code>ShellExecute(NULL, &quot;open&quot;, &quot;cmd.exe&quot;, &quot;/C bcdedit &gt; file_output.txt&quot;, NULL, SW_SHOWNORMAL);
  </code></pre>
  <p>The file is generated, but nothing is in the file. I can execute that same command in cmd.exe as an Administrator and it works. I've also tried:</p>
  <pre><code>ShellExecute(NULL, &quot;open&quot;, &quot;cmd.exe&quot;, &quot;/C bcdedit /enum all &gt; file_output.txt&quot;, NULL, SW_SHOWNORMAL);
  </code></pre>
  <p>Nothing with bcdedit works. There are no errors. Here are a few other methods I've tried:</p>
  <ol>
  <li>Using CreateProcess instead.</li>
  <li>Using system instead.</li>
  <li>Setting the directory to C:\Windows\System32</li>
  <li>Setting the directory to C:\Windows\SysWOW64\</li>
  </ol>
  <p>Again, executing the same command in cmd.exe works, but it doesn't seem to work in my code. I've been searching all day and I can't seem to find something that works. Any ideas?</p>
  <hr />
  <p>Edit: After further debugging, now I'm seeing the following with the command.</p>
  <blockquote>
  <p>'bcdedit' is not recognized as an internal or external command, operable program or batch file.</p>
  <p>'C:\Windows\System32\bcdedit.exe' is not recognized as an internal or external c
  ommand, operable program or batch file.</p>
  </blockquote>
  <p>I've tried all 4 methods listed above again and it apparently still cannot be recognized as a command. **bcdedit.exe does in fact exist in C:\Windows\System32**.</p>