C:\DOCUME~1\My Documents><strong>type mybat.bat</strong>
C:\windows\system32\reg.exe export HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro C:\myreg.reg
C:\DOCUME~1\My Documents><strong>reg export HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro mytest.reg</strong>
The operation completed successfully
C:\DOCUME~1\My Documents><strong>mybat.bat</strong>
C:\DOCUME~1\My Documents>■C
'■C' is not recognized as an internal or external command,
operable program or batch file.
如果只是執行"reg export HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro mytest.reg"是成功的, 但是寫成.bat格式, 反而不行, 為什麼啊??
回答:sailsolitary( iT邦初學者7級 )
批次檔的語法中, 沒有 <strong> </strong> 這個東西... 當成會執行失敗 ~
↓
'■C' is not recognized as an internal
# C:\DOCUME~1\My Documents><strong>type mybat.bat</strong>
C:\windows\system32\reg.exe export HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro C:...(恕刪)
批次檔的語法中, 沒有 <strong> </strong> 這個東西... 當成會執行失敗 ~
把 mybat.bat 的內容改成 ↓
<pre class="c" name="code">
C:\windows\system32\reg.exe export HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro C:\myreg.reg
jeje提到:
HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro
請您把這串文字,前後加上雙引號