|
2#
楼主 |
发表于 2010-9-17 02:15:03
|
只看该作者
- title 替换、恢复Win7RE Code by Shuaicai
- echo off
- :sys_drive
- color 1f
- cls
- echo.
- echo.请输入系统盘盘符,如:C
- echo.
- echo.若为C盘 回车即可
- echo.
- set sys_drive=
- set /p sys_drive=否则请输入:
- if "%sys_drive%"=="" set sys_drive=C:
- set sys_drive=%sys_drive:~0,1%:
- for /f %%a in ('dir /b/ad %sys_drive%\Recovery') do (
- if exist %sys_drive%\Recovery\%%a\boot.sdi (
- set reuid=%%a&goto :sys_drive_ok
- ))
- color 4f
- cls
- echo.
- echo.找不到boot.sdi
- echo.
- set /p t=按回车键重新输入盘符. . .
- goto :sys_drive
- :sys_drive_ok
- if exist %sys_drive%\Recovery\%reuid%\Winre_bak.wim (
- del /a /f /q %sys_drive%\Recovery\%reuid%\Winre.wim
- attrib -s -h %sys_drive%\Recovery\%reuid%\Winre_bak.wim
- ren %sys_drive%\Recovery\%reuid%\Winre_bak.wim Winre.wim
- attrib +s +h %sys_drive%\Recovery\%reuid%\Winre.wim
- color 1f
- cls
- echo.
- echo.已恢复Win7RE
- echo.
- set /p t=按回车键可再次替换Win7RE. . .
- )
- :pe_path
- color 1f
- cls
- echo.
- echo.请输入Win7PE的WIM映像文件的路径 如C:\System\boot.wim
- echo.
- echo.如果输入的是文件夹的路径 如C:\System 则默认WIM文件为boot.wim
- echo.
- echo.若为%cd%\boot.wim 回车即可
- echo.
- set pe_path=
- set /p pe_path=否则请输入:
- if "%pe_path%"=="" set pe_path=%cd%\boot.wim
- if "%pe_path:~-1%"=="" set pe_path=%pe_path%boot.wim
- if /i not "%pe_path:~-4%"==".wim" set pe_path=%pe_path%\boot.wim
- if exist "%pe_path%" goto :pe_path_ok
- color 4f
- cls
- echo.
- echo."%pe_path%"不存在
- echo.
- set /p t=按回车键重新输入路径. . .
- goto :pe_path
- :pe_path_ok
- color 0f
- cls
- attrib -s -h %sys_drive%\Recovery\%reuid%\Winre.wim
- ren %sys_drive%\Recovery\%reuid%\Winre.wim Winre_bak.wim
- attrib +s +h %sys_drive%\Recovery\%reuid%\Winre_bak.wim
- echo F|xcopy "%pe_path%" %sys_drive%\Recovery\%reuid%\Winre.wim /y /r /h
- attrib +s +h %sys_drive%\Recovery\%reuid%\Winre.wim
- color 1f
- cls
- echo.
- echo.已替换Win7RE
- echo.
- set /p t=按回车键可进行其它操作. . .
- goto :sys_drive
复制代码 |
|