在命令行中最好使用REG工具而不是 REGEDIT:
REG IMPORT yourfile.reg
REG 是为控制台模式设计的,而 REGEDIT 是为图形模式设计的。这就是为什么运行regedit.exe /S yourfile.reg是一个坏主意的原因,因为如果出现错误,您将不会收到通知,而 REG 工具会提示:
> REG IMPORT missing_file.reg
ERROR: Error opening the file. There may be a disk or file system error.
> %windir%\System32\reg.exe /?
REG Operation [Parameter List]
Operation [ QUERY | ADD | DELETE | COPY |
SAVE | LOAD | UNLOAD | RESTORE |
COMPARE | EXPORT | IMPORT | FLAGS ]
Return Code: (Except for REG COMPARE)
0 - Successful
1 - Failed
For help on a specific operation type:
REG Operation /?
Examples:
REG QUERY /?
REG ADD /?
REG DELETE /?
REG COPY /?
REG SAVE /?
REG RESTORE /?
REG LOAD /?
REG UNLOAD /?
REG COMPARE /?
REG EXPORT /?
REG IMPORT /?
REG FLAGS /?