|
[注意]深山红叶启动光盘(WinPE&PE Builder)讨论专帖(违令者必删)
本人根据实战中的需要,专门制作了一个批处理用于将用户数据文件夹快速批量转移到非系统分区,只用一个批处理文件完成所有的操作,而且可接收用户的自定义输入。将下列内容保存到一个文本文件,文件扩展名必需是 .cmd(如.PathChange.CMD),欢迎大家测试(测试前请用记事本打开查看!!不会批处理的兄弟请不要运行!):
@echo off
rem 取消对Windows98的支持
if exist %SystemRoot%\system\Dxdiag.exe goto end
:start
cls
color 1f
echo.
echo.
ECHO 用户重要数据文件夹重定向程序
echo.
ECHO 深山红叶制作
echo.
ECHO ========================================================
echo.
echo 本程序可快速将当前用户的系列默认数据文件夹转移到非系统分区,
echo 以便在系统恢复及系统故障时,用户数据不会受到破坏!
echo.
echo 请输入您想移动的系列用户数据文件夹的目标路径。
echo 其他如收藏夹、我的文档、我的图片、桌面、OE 邮件等,
echo 均将转移到指定的目标文件夹下。
echo.
echo 注意:
echo 1. 如果不输入,则默认目标路径将设置为 D:\我的文档
echo 2. 文件夹路径中的盘符及斜杠必须用半角输入!
echo.
SET Choice=D:\我的文档
SET /P Choice= 新的用户数据文件夹路径为(回车则默认为“D:\我的文档”):
ECHO.
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v Cache /d "%Choice%\Temporary Internet Files">nul 2>nul
if exist "%Choice%\Temporary Internet Files" attrib +h "%Choice%\Temporary Internet Files">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v Desktop /d "%Choice%\桌面">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v Favorites /d "%Choice%\收藏夹">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v Personal /d "%Choice%\个人文档">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v "My Music" /d "%Choice%\我的音乐">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v "My Pictures" /d "%Choice%\我的图片">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v Recent /d "%Choice%\最近文档">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Cache /d "%Choice%\Temporary Internet Files">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Desktop /d "%Choice%\桌面">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Favorites /d "%Choice%\收藏夹">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Personal /d "%Choice%\个人文档">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v "My Music" /d "%Choice%\我的音乐">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v "My Pictures" /d "%Choice%\我的图片">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Recent /d "%Choice%\最近文档">nul 2>nul
reg add "HKCU\Identities\{F4E98C86-4D9A-463F-920C-1DF555C3B434}\Software\Microsoft\Outlook Express\5.0" /f /v "Store Root" /d "%Choice%\OE 邮件">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Cache /d "%Choice%\Temporary Internet Files">nul 2>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /f /v Desktop /d "%Choice%\桌面">nul 2>nul
reg add "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v Desktop /d "%Choice%\桌面">nul 2>nul
reg add "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v Cache /d "%Choice%\Temporary Internet Files">nul 2>nul
reg add "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /f /v "Download Directory" /d "%Choice%\下载文件">nul 2>nul
reg add "HKCU\Environment" /f /v TEMP /d "%SystemRoot%\TEMP">nul 2>nul
reg add "HKCU\Environment" /f /v TMP /d "%SystemRoot%\TEMP">nul 2>nul
echo 用户系列数据文件夹重定向设置完毕!
echo 正在开始转移现有用户数据文件,请稍候……
if not exist "%Choice%\nul" md "%Choice%">nul 2>nul
if not exist "%Choice%\桌面\nul" md "%Choice%\桌面">nul 2>nul
if not exist "%Choice%\收藏夹\nul" md "%Choice%\收藏夹">nul 2>nul
if not exist "%Choice%\我的图片\nul" md "%Choice%\我的图片">nul 2>nul
if not exist "%Choice%\我的音乐\nul" md "%Choice%\我的音乐">nul 2>nul
move /-Y "%USERPROFILE%\My Documents\*.*" "%Choice%">nul 2>nul
move /-Y "%USERPROFILE%\Desktop\*.*" "%Choice%\桌面">nul 2>nul
move /-Y "%USERPROFILE%\桌面\*.*" "%Choice%\桌面">nul 2>nul
move /-Y "%USERPROFILE%\Favorites\*.*" "%Choice%\收藏夹">nul 2>nul
move /-Y "%USERPROFILE%\My Pictures\*.*" "%Choice%\我的图片">nul 2>nul
move /-Y "%USERPROFILE%\My Music\*.*" "%Choice%\我的音乐">nul 2>nul
:end
echo.
echo 用户系列数据文件夹重定向设置及数据转移完毕!
echo 您的当前用户关键数据文件夹已经转移到了“%Choice%”!
echo.
echo 请立即重新登录系统后生效!任意键退出!
Pause>nul
exit
|
|