@echo off
setlocal
:: 设置注册表信息保存的文件路径
set REG_FILE=%UserProfile%\RegistryBackup.txt
:: 导出HKEY_CURRENT_USER下的注册表信息
reg export HKCU “%REG_FILE%” /y >nul
:: 导出HKEY_LOCAL_MACHINE下的注册表信息
reg export HKLM “%REG_FILE%” /y >nul
:: 导出HKEY_USERS下的注册表信息
for /f “tokens=3*” %%a in (‘reg query “HKU” /s /k ^| findstr /i “0x”‘) do (
set USER_KEY=%%a
set USER_NAME=%%b
reg export “HKU\!USER_KEY!” “%UserProfile%\%USER_NAME%_RegistryBackup.txt” /y >nul
)
echo 注册表信息已导出到 %UserProfile%\RegistryBackup.txt
endlocal
pause
发表回复