|
本帖最后由 zhouaga 于 2021-8-5 19:40 编辑
- @ECHO OFF&SETLOCAL enabledelayedexpansion
- title IE配置一键备份与还原!!
- @echo off
- cls
- ::管理员权限
- echo ==========================================================
- @echo off
- >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
- if '%errorlevel%' NEQ '0' (
- goto UACPrompt
- ) else ( goto gotAdmin )
- :UACPrompt
- echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
- echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
- "%temp%\getadmin.vbs"
- exit /B
- :gotAdmin
- if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
- :start
- cls
- echo.
- echo 今天是%date%
- echo.
- echo 现在已经是%time%
- echo.
- echo ==========================================================
- color 0a
- ECHO.
- ECHO.
- ECHO. 1、IE配置备份
- ECHO.
- ECHO. 2、IE配置恢复
- ECHO.
- ECHO.
- set /P var="请输入您需要的序号:"
- if %var%==1 goto IE1
- if %var%==2 goto IE2
- CLS
- ECHO.
- ECHO 输入有误,按任意键返回主菜单。
- PAUSE >>nul
- goto start
- :IE1
- prompt 行动-》$p$g
- @echo off
- Allowedwritereg.vbs
- ::判断操作系统版本
- for /f "tokens=1* delims=[" %%a in ('ver') do set b=%%b
- ::将版本信息赋值给变量b
- set b=%b:* =%
- ::输出指定值
- echo %b:~0,4%
- echo %PROCESSOR_ARCHITECTURE:~-1%
- echo %b:~0,4%%PROCESSOR_ARCHITECTURE:~-1%
- ::调用指定值对应的cmd命令行
- call:%b:~0,4%%PROCESSOR_ARCHITECTURE:~-1%
- pause&exit
- :6.1.6
- echo 系统版本:Win7_32位
- echo 开始导出IE配置
- REGEDIT /E "IEback1.reg" "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer"
- REGEDIT /E "IEback2.reg" "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
- REGEDIT /E "IEback3.reg" "HKEY_CURRENT_USER\Keyboard Layout"
- REGEDIT /E "IEback4.reg" "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows"
-
- if exist "*.reg" (
- echo IE配置导出成功!
- ) else echo IE配置导出失败!
- PAUSE
- cls
- goto start
-
- :6.1.4
- echo 系统版本:Win7_64位
- echo 开始导出IE配置
- REGEDIT /E "IEback1.reg" "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer"
- REGEDIT /E "IEback2.reg" "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
- REGEDIT /E "IEback3.reg" "HKEY_CURRENT_USER\Keyboard Layout"
- REGEDIT /E "IEback4.reg" "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows"
- if exist "*.reg" (
- echo IE配置导出成功!
- ) else echo IE配置导出失败!
- PAUSE
- cls
- goto start
- :IE2
- prompt 行动-》$p$g
- @echo off
- Allowedwritereg.vbs
- ::判断操作系统版本
- for /f "tokens=1* delims=[" %%a in ('ver') do set b=%%b
- ::将版本信息赋值给变量b
- set b=%b:* =%
- ::输出指定值
- echo %b:~0,4%
- echo %PROCESSOR_ARCHITECTURE:~-1%
- echo %b:~0,4%%PROCESSOR_ARCHITECTURE:~-1%
- ::调用指定值对应的cmd命令行
- call:%b:~0,4%%PROCESSOR_ARCHITECTURE:~-1%
- pause&exit
- :6.1.6
- echo 系统版本:Win7_32位
- @echo off
- echo 开始导入备份的IE配置
- REGEDIT /S "IEback1.reg"
- REGEDIT /S "IEback2.reg"
- REGEDIT /S "IEback3.reg"
- REGEDIT /S "IEback4.reg"
- echo IE配置导入完成
- PAUSE
- cls
- goto start
- :6.1.4
- echo 系统版本:Win7_64位
- @echo off
- echo 开始导入备份的IE配置
- REGEDIT /S "IEback1.reg"
- REGEDIT /S "IEback2.reg"
- REGEDIT /S "IEback3.reg"
- REGEDIT /S "IEback4.reg"
- echo IE配置导入完成
- PAUSE
- cls
- goto start
复制代码 https://www.aliyundrive.com/s/cTLUVnUEqye |
|