如何从REG QUERY获取特定列?

时间:2014-03-27 08:55:50

标签: cmd registry

c:>REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  XSENZ REG_SZ C:\Windows\syswow64\XSENZ.EXE
  Persistence REG_SZ C:\windows\system32\igfxpers.exe
  IntelliPoint REG_SZ "c:\Program Files\Microsoft IntelliPoint\ipoint.exe"
  IgfxTray REG_SZ C:\windows\system32\igfxtray.exe
  HotKeysCmds REG_SZ C:\windows\system32\hkcmd.exe

我想只获得第一列。有谁能提出答案?

1 个答案:

答案 0 :(得分:2)

for /f %%a in ('REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run') do @echo %%a|find /v "\"

应该适合你。如果您直接从提示中投放,请将%%缩减为%