AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1706713
Accepted
Ghost_Dz
Ghost_Dz
Asked: 2022-02-25 03:10:06 +0800 CST2022-02-25 03:10:06 +0800 CST 2022-02-25 03:10:06 +0800 CST

如何转换多个 .reg 文件以在单个 .bat 脚本中使用?

  • 772

我有三个.reg文件,需要在一个.bat脚本中使用它们:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLUA"=dword:00000001

Windows Registry Editor Version 5.00

; Originally created at howtogeek.com

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLUA"=dword:00000000

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\International]
"Locale"="00000809"
"LocaleName"="en-GB"
"s1159"="AM"
"s2359"="PM"
"sCountry"="United Kingdom"
"sCurrency"="£"
"sDate"="/"
"sDecimal"="."
"sGrouping"="3;0"
"sLanguage"="ENG"
"sList"=","
"sLongDate"="d MMMM yyyy"
"sMonDecimalSep"="."
"sMonGrouping"="3;0"
"sMonThousandSep"=","
"sNativeDigits"="0123456789"
"sNegativeSign"="-"
"sPositiveSign"=""
"sShortDate"="dd/MM/yyyy"
"sThousand"=","
"sTime"=":"
"sTimeFormat"="HH:mm:ss"
"sShortTime"="HH:mm"
"sYearMonth"="MMMM yyyy"
"iCalendarType"="1"
"iCountry"="44"
"iCurrDigits"="2"
"iCurrency"="0"
"iDate"="1"
"iDigits"="2"
"NumShape"="1"
"iFirstDayOfWeek"="0"
"iFirstWeekOfYear"="0"
"iLZero"="1"
"iMeasure"="0"
"iNegCurr"="1"
"iNegNumber"="1"
"iPaperSize"="9"
"iTime"="1"
"iTimePrefix"="0"
"iTLZero"="1"

[HKEY_CURRENT_USER\Control Panel\International\Geo]
"Nation"="244"
batch-file windows-registry
  • 3 3 个回答
  • 1281 Views

3 个回答

  • Voted
  1. harrymc
    2022-02-25T04:13:52+08:002022-02-25T04:13:52+08:00

    您可以使用免费的 Reg Converter 将任何.reg文件 转换为 您可以放入文件中的reg 命令.bat,

    例如,这里它如何转换第三个和最长的文件,添加管理员权限测试(reg命令所需)。

    您可以对其他两个较小的文件执行相同的操作,并将它们的 reg命令添加到此文件中:

    @Echo Off
    Title Reg Converter v1.2 & Color 1A
    cd %systemroot%\system32
    call :IsAdmin
    
    Reg.exe add "HKCU\Control Panel\International" /v "Locale" /t REG_SZ /d "00000809" /f
    Reg.exe add "HKCU\Control Panel\International" /v "LocaleName" /t REG_SZ /d "en-GB" /f
    Reg.exe add "HKCU\Control Panel\International" /v "s1159" /t REG_SZ /d "AM" /f
    Reg.exe add "HKCU\Control Panel\International" /v "s2359" /t REG_SZ /d "PM" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sCountry" /t REG_SZ /d "United Kingdom" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sCurrency" /t REG_SZ /d "£" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sDate" /t REG_SZ /d "/" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sDecimal" /t REG_SZ /d "." /f
    Reg.exe add "HKCU\Control Panel\International" /v "sGrouping" /t REG_SZ /d "3;0" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sLanguage" /t REG_SZ /d "ENG" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sList" /t REG_SZ /d "," /f
    Reg.exe add "HKCU\Control Panel\International" /v "sLongDate" /t REG_SZ /d "d MMMM yyyy" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sMonDecimalSep" /t REG_SZ /d "." /f
    Reg.exe add "HKCU\Control Panel\International" /v "sMonGrouping" /t REG_SZ /d "3;0" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sMonThousandSep" /t REG_SZ /d "," /f
    Reg.exe add "HKCU\Control Panel\International" /v "sNativeDigits" /t REG_SZ /d "0123456789" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sNegativeSign" /t REG_SZ /d "-" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sPositiveSign" /t REG_SZ /d "" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sShortDate" /t REG_SZ /d "dd/MM/yyyy" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sThousand" /t REG_SZ /d "," /f
    Reg.exe add "HKCU\Control Panel\International" /v "sTime" /t REG_SZ /d ":" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sTimeFormat" /t REG_SZ /d "HH:mm:ss" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sShortTime" /t REG_SZ /d "HH:mm" /f
    Reg.exe add "HKCU\Control Panel\International" /v "sYearMonth" /t REG_SZ /d "MMMM yyyy" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iCalendarType" /t REG_SZ /d "1" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iCountry" /t REG_SZ /d "44" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iCurrDigits" /t REG_SZ /d "2" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iCurrency" /t REG_SZ /d "0" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iDate" /t REG_SZ /d "1" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iDigits" /t REG_SZ /d "2" /f
    Reg.exe add "HKCU\Control Panel\International" /v "NumShape" /t REG_SZ /d "1" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iFirstDayOfWeek" /t REG_SZ /d "0" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iFirstWeekOfYear" /t REG_SZ /d "0" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iLZero" /t REG_SZ /d "1" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iMeasure" /t REG_SZ /d "0" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iNegCurr" /t REG_SZ /d "1" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iNegNumber" /t REG_SZ /d "1" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iPaperSize" /t REG_SZ /d "9" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iTime" /t REG_SZ /d "1" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iTimePrefix" /t REG_SZ /d "0" /f
    Reg.exe add "HKCU\Control Panel\International" /v "iTLZero" /t REG_SZ /d "1" /f
    Reg.exe add "HKCU\Control Panel\International\Geo" /v "Nation" /t REG_SZ /d "244" /f
    Exit
    
    :IsAdmin
    Reg.exe query "HKU\S-1-5-19\Environment"
    If Not %ERRORLEVEL% EQU 0 (
      Cls & Echo You must have administrator rights to continue ... 
      Pause & Exit
    )
    Cls
    goto:eof
    
    • 6
  2. Best Answer
    cybernard
    2022-02-25T09:03:40+08:002022-02-25T09:03:40+08:00

    将所有内容混合到一个注册表文件中:

    Windows Registry Editor Version 5.00
        
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
    "EnableLUA"=dword:00000001
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
    "EnableLUA"=dword:00000000
        
    [HKEY_CURRENT_USER\Control Panel\International] 
    "Locale"="00000809"
    "LocaleName"="en-GB"
    "s1159"="AM"
    "s2359"="PM"
    "sCountry"="United Kingdom"
    "sCurrency"="£"
    "sDate"="/"
    "sDecimal"="."
    "sGrouping"="3;0"
    "sLanguage"="ENG"
    "sList"=","
    "sLongDate"="d MMMM yyyy"
    "sMonDecimalSep"="."
    "sMonGrouping"="3;0"
    "sMonThousandSep"=","
    "sNativeDigits"="0123456789"
    "sNegativeSign"="-"
    "sPositiveSign"=""
    "sShortDate"="dd/MM/yyyy"
    "sThousand"=","
    "sTime"=":"
    "sTimeFormat"="HH:mm:ss"
    "sShortTime"="HH:mm"
    "sYearMonth"="MMMM yyyy"
    "iCalendarType"="1"
    "iCountry"="44"
    "iCurrDigits"="2"
    "iCurrency"="0"
    "iDate"="1"
    "iDigits"="2"
    "NumShape"="1"
    "iFirstDayOfWeek"="0"
    "iFirstWeekOfYear"="0"
    "iLZero"="1"
    "iMeasure"="0"
    "iNegCurr"="1"
    "iNegNumber"="1"
    "iPaperSize"="9"
    "iTime"="1"
    "iTimePrefix"="0"
    "iTLZero"="1"
    
    [HKEY_CURRENT_USER\Control Panel\International\Geo]
    "Nation"="244"
    
    • 5
  3. Io-oI
    2022-02-25T04:02:48+08:002022-02-25T04:02:48+08:00

    对于统一文件中的一个或多个注册表条目,请尝试以下混合 file.cmd+ file.reg:

    • 另存为file.bat/file.cmd并以管理员身份运行:
      Windows Registry Editor Version 5.00
      
      ;@(cls & %__APPDIR__%reg.exe import "%~f0" >nul 2>nul & goto :EOF)
      
      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
      "EnableLUA"=dword:00000001
      
      [HKEY_CURRENT_USER\Control Panel\International]
      "Locale"="00000809"
      "LocaleName"="en-GB"
      "s1159"="AM"
      "s2359"="PM"
      "sCountry"="United Kingdom"
      "sCurrency"="£"
      "sDate"="/"
      "sDecimal"="."
      "sGrouping"="3;0"
      "sLanguage"="ENG"
      "sList"=","
      "sLongDate"="d MMMM yyyy"
      "sMonDecimalSep"="."
      "sMonGrouping"="3;0"
      "sMonThousandSep"=","
      "sNativeDigits"="0123456789"
      "sNegativeSign"="-"
      "sPositiveSign"=""
      "sShortDate"="dd/MM/yyyy"
      "sThousand"=","
      "sTime"=":"
      "sTimeFormat"="HH:mm:ss"
      "sShortTime"="HH:mm"
      "sYearMonth"="MMMM yyyy"
      "iCalendarType"="1"
      "iCountry"="44"
      "iCurrDigits"="2"
      "iCurrency"="0"
      "iDate"="1"
      "iDigits"="2"
      "NumShape"="1"
      "iFirstDayOfWeek"="0"
      "iFirstWeekOfYear"="0"
      "iLZero"="1"
      "iMeasure"="0"
      "iNegCurr"="1"
      "iNegNumber"="1"
      "iPaperSize"="9"
      "iTime"="1"
      "iTimePrefix"="0"
      "iTLZero"="1"
      
      [HKEY_CURRENT_USER\Control Panel\International\Geo]
      "Nation"="244"
      

    观察。1.只使用一个值;添加一个时,另一个值将覆盖第一个值,因此在同一 reg 中使用一个或另一个,而不是两者:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
    "EnableLUA"=dword:00000001
    
    ; // use one or the other not both  // ;
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
    "EnableLUA"=dword:00000000
    

    Obs.: 2.也可以另存为file.reg,开头的那一行;会被当作注释,导入替换%__APPDIR__%reg.exe import "%~f0"为%__APPDIR__%reg.exe import "file.reg"

    • 4

相关问题

  • Windows 2016 不会运行 .bat 文件

  • 如何制作批处理脚本来备份具有唯一目标文件夹的特定文件(Windows)[关闭]

  • 如何在 Windows 10 中将注册表恢复为默认值?

  • 如何在 Windows Precision 触摸板上禁用鼠标加速?

  • MS Office 与 Netscape Navigator 有什么联系?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 为什么通过电缆(同轴电缆)的千兆位/秒 Internet 连接不能像光纤一样提供对称速度? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve