从批处理文件查询注册表时,可以查询数据吗? [英] When querying the registry from a batch file, can I query the Data?

查看:48
本文介绍了从批处理文件查询注册表时,可以查询数据吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下查询-

@ECHO OFF
REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Flight Simulator\10.0" /v AppPath
PAUSE

这将返回条目的名称,类型和数据,如下所示-

This returns the Name, Type, and Data of the entry, as below -

HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Flight Simulator\10.0
    AppPath    REG_SZ    C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\

Press any key to continue . . .


是否只能检索注册表项的数据"部分?


Is it possible to retrieve only the Data section of a registry entry?

推荐答案

for /f "tokens=2*" %%a in ('REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Microsoft Games\Flight Simulator\10.0" /v AppPath') do set "AppPath=%%~b"
echo %AppPath%
pause

这篇关于从批处理文件查询注册表时,可以查询数据吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆