title: In batch file WITHOUT Admin Right, FOR command can't return output from ('command'), due to ERROR: xxx is not recognized as...command
body: <p>I'm On <strong>Windows 10.0.16299.125</strong>.</p>
  
  <p>Codes inside my Batch file:</p>
  
  <pre><code>@echo off
  for /f "delims=" %%a in ('ver') do echo %%a
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>'ver' is not recognized as an internal or external command,
  operable program or batch file.
  </code></pre>
  
  <p>I found if I run it without Administrator right, it comes with this error.<br>
  However, batch files always <strong>run as Normal right</strong> after I double-click it, even I'm logging as an Administrator account.</p>
  
  <p>It works correctly before, but it just broke recently.</p>
  
  <p>I have confirmed my Registry and Environment variables:</p>
  
  <pre><code>Reg: HKCR\batfile\shell\open\command: "%1" %*
  Env: ComSpec=C:\WINDOWS\system32\cmd.exe
  </code></pre>
  
  <p><strong>Is it normal that FOR command can't work properly without Admin right?</strong></p>
  
  <p>I'm trying to restore cmd.exe by running <code>sfc.exe /scannow</code>. Thanks for any helping!! </p>
  
  <hr>
  
  <p><strong>Edit:</strong> I tried <code>sfc /scannow</code>. After finished, I checked <strong>"%WinDir%\Logs\CBS\CBS.log"</strong></p>
  
  <pre><code>C:\WINDOWS\system32&gt;findstr "cmd.exe" %WinDir%\Logs\CBS\CBS.log
  2018-02-12 01:14:47, Info                  CSI    00000007 Hashes for file member [l:7]'cmd.exe' do not match.
  2018-02-12 01:15:56, Info                  CBS    Repr: Add missing payload:amd64_microsoft-windows-commandprompt_31bf3856ad364e35_10.0.16299.15_none_adf8f2af8b80fc99\cmd.exe
  (p)     CSI Payload Corrupt     (Fixed) amd64_microsoft-windows-commandprompt_31bf3856ad364e35_10.0.16299.15_none_adf8f2af8b80fc99\cmd.exe
  2018-02-12 01:26:24, Info                  CSI    00001290 Hashes for file member [l:7]'cmd.exe' do not match.
  2018-02-12 01:26:24, Info                  CSI    00001291 [SR] Repairing corrupted file \??\C:\WINDOWS\System32\cmd.exe from store
  2018-02-12 01:36:47, Info                  CSI    000067ab Hashes for file member [l:7]'cmd.exe' do not match.
  2018-02-12 01:36:47, Info                  CSI    000067ac [SR] Repairing corrupted file \??\C:\WINDOWS\System32\cmd.exe from store
  </code></pre>
  
  <h2>The log seems succeed repairing cmd.exe. However, when I tried again, <code>FOR</code> still failed...</h2>