三月
11
用批处理修改XP系统文件夹址
11
一般我们重装系统时,都要去备案我的文档、桌面、收藏夹等这些文件夹到非系统盘的地方。
这样很不方便,尤其对于象午夜客这种装机狂人,一个星期装一次系统的人。有时忘记了备份资料导致文件丢失是件很痛苦的事。
所以系统时,就把这些重要的常用文件夹改到非系统盘的地方是很有必要的。
但改这些文件夹有时要手工去改注册表,显得有些麻烦。所以可以写一个批处理,一键完成系列更改动作。
提醒:本代码属转载,使用前建议先备份系统或注册表,以备恢复。
@ECHO OFF
color 0a
rem 颜色定义
echo XP默认路径修改工具 V0.1 by:yangwei0577@sina.com
echo ================================================================================
echo 本程序可批量修改和移动除:
echo IE临时文件夹(Temporary Internet Files),
echo 用户临时文件夹(Templates)和我的文档
echo 外的所有Documents and Settings文件夹到D盘下
echo ————————————————–
echo 需注意:当前系统需为XP 你的XP装在C盘下
echo 提示:建议在新装或即将重装的系统上运行本工具。
echo 若想修改“我的文档”路径可手动修改:在“我的文档”图标上右击》“属性”》修改“目标文件夹”
echo ================================================================================
echo 》即将修改和移动储存“桌面”“开始菜单”和“收藏夹”的相关文件夹到D盘下!
echo.
PAUSE
echo.
ehco 正在设置,请稍等…
if not exist “D:\Documents and Settings\All Users\桌面” md “D:\Documents and Settings\All Users\桌面”
if not exist “D:\Documents and Settings\Users\桌面” md “D:\Documents and Settings\user\桌面”
xcopy “C:\Documents and Settings\All Users\桌面” “D:\Documents and Settings\All Users\桌面” /e /h /k /y /C
xcopy “%USERPROFILE%\桌面” “D:\Documents and Settings\User\桌面” /e /h /k /y /C
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Desktop” /d “D:\Documents and Settings\user\桌面” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Desktop” /d “D:\Documents and Settings\All Users\桌面” /f
if not exist “D:\Documents and Settings\All Users\「开始」菜单” md “D:\Documents and Settings\All Users\「开始」菜单”
if not exist “D:\Documents and Settings\user\「开始」菜单” md “D:\Documents and Settings\user\「开始」菜单”
xcopy “C:\Documents and Settings\All Users\「开始」菜单” “D:\Documents and Settings\All Users\「开始」菜单” /e /h /k /y /C
xcopy “%USERPROFILE%\「开始」菜单” “D:\Documents and Settings\User\「开始」菜单” /e /h /k /y /C
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Start Menu” /d “D:\Documents and Settings\user\「开始」菜单” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Programs” /d “D:\Documents and Settings\user\「开始」菜单\程序” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Startup” /d “D:\Documents and Settings\user\「开始」菜单\程序\启动” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Start Menu” /d “D:\Documents and Settings\All Users\「开始」菜单” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Programs” /d “D:\Documents and Settings\All Users\「开始」菜单\程序” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Startup” /d “D:\Documents and Settings\All Users\「开始」菜单\程序\启动” /f
if not exist “D:\Documents and Settings\All Users\Favorites” md “D:\Documents and Settings\All Users\Favorites”
if not exist “D:\Documents and Settings\user\Favorites” md “D:\Documents and Settings\user\Favorites”xcopy “C:\Documents and Settings\All Users\Favorites” “D:\Documents and Settings\All Users\Favorites” /e /h /k /y /C
xcopy “%USERPROFILE%\Favorites” “D:\Documents and Settings\user\Favorites” /e /h /k /y /C
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Favorites” /d “D:\Documents and Settings\user\Favorites” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Favorites” /d “D:\Documents and Settings\All Users\Favorites” /fecho 》是否还要修改和移动除IE临时文件夹(Temporary Internet Files)和用户临时文件夹(Templates)和我的文档外的所有Documents and Settings文件夹更改到D盘下?
PAUSE
if not exist “D:\Documents and Settings\user\Favorites” md “D:\Documents and Settings\user\Favorites”
if not exist “D:\Documents and Settings\user\Local Settings\History” md “D:\Documents and Settings\user\Local Settings\History”
if not exist “D:\Documents and Settings\user\Cookies” md “D:\Documents and Settings\user\Cookies”
if not exist “D:\Documents and Settings\user\Fonts” md “D:\Documents and Settings\user\Fonts”
if not exist “D:\Documents and Settings\user\NetHood” md “D:\Documents and Settings\user\NetHood”
if not exist “D:\Documents and Settings\user\PrintHood” md “D:\Documents and Settings\user\PrintHood”
if not exist “D:\Documents and Settings\user\Recent” md “D:\Documents and Settings\user\Recent”
if not exist “D:\Documents and Settings\user\SendTo” md “D:\Documents and Settings\user\SendTo”
echo 正在移动当前用户文件
xcopy “%USERPROFILE%\Local Settings\Application Data” “D:\Documents and Settings\user\Local Settings\Application Data” /e /h /k /y /C
xcopy “%USERPROFILE%\Local Settings\History” “D:\Documents and Settings\user\Local Settings\History” /e /h /k /y /C
xcopy “%USERPROFILE%\Cookies” “D:\Documents and Settings\user\Cookies” /e /h /k /y /C
xcopy “%USERPROFILE%\Fonts” “D:\Documents and Settings\user\Fonts” /e /h /k /y /C
xcopy “%USERPROFILE%\NetHood” “D:\Documents and Settings\user\NetHood” /e /h /k /y /C
xcopy “%USERPROFILE%\PrintHood” “D:\Documents and Settings\user\PrintHood” /e /h /k /y /C
xcopy “%USERPROFILE%\Recent” “D:\Documents and Settings\user\Recent” /e /h /k /y /C
xcopy “%USERPROFILE%\SendTo” “D:\Documents and Settings\user\SendTo” /e /h /k /y /C
if not exist “D:\Documents and Settings\All Users\Favorites” md “D:\Documents and Settings\All Users\Favorites”
if not exist “D:\Documents and Settings\All Users\Local Settings\History” md “D:\Documents and Settings\All Users\Local Settings\History”
if not exist “D:\Documents and Settings\All Users\Cookies” md “D:\Documents and Settings\All Users\Cookies”
if not exist “D:\Documents and Settings\All Users\Fonts” md “D:\Documents and Settings\All Users\Fonts”
if not exist “D:\Documents and Settings\All Users\NetHood” md “D:\Documents and Settings\All Users\NetHood”
if not exist “D:\Documents and Settings\All Users\PrintHood” md “D:\Documents and Settings\All Users\PrintHood”
if not exist “D:\Documents and Settings\All Users\Recent” md “D:\Documents and Settings\All Users\Recent”
if not exist “D:\Documents and Settings\All Users\SendTo” md “D:\Documents and Settings\All Users\SendTo”
echo 正在移动All Users文件
xcopy “C:\Documents and Settings\All Users\Local Settings\Application Data” “D:\Documents and Settings\All Users\Local Settings\Application Data” /e /h /k /y /C
xcopy “C:\Documents and Settings\All Users\Local Settings\History” “D:\Documents and Settings\All Users\Local Settings\History” /e /h /k /y /C
xcopy “C:\Documents and Settings\All Users\Cookies” “D:\Documents and Settings\All Users\Cookies” /e /h /k /y /C
xcopy “C:\Documents and Settings\All Users\Fonts” “D:\Documents and Settings\All Users\Fonts” /e /h /k /y /C
xcopy “C:\Documents and Settings\All Users\NetHood” “D:\Documents and Settings\All Users\NetHood” /e /h /k /y /C
xcopy “C:\Documents and Settings\All Users\PrintHood” “D:\Documents and Settings\All Users\PrintHood” /e /h /k /y /C
xcopy “C:\Documents and Settings\All Users\Recent” “D:\Documents and Settings\All Users\Recent” /e /h /k /y /C
xcopy “C:\Documents and Settings\All Users\SendTo” “D:\Documents and Settings\All Users\SendTo” /e /h /k /y /C
rem 复制文件夹到指定路径
echo 正在修改当前用户
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “AppData” /d “D:\Documents and Settings\user\Local Settings\Application Data” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “CD Burning” /d “D:\Documents and Settings\user\Local Settings\Application Data\Microsoft\CD Burning” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Cookies” /d “D:\Documents and Settings\user\Cookies” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Fonts” /d “D:\Documents and Settings\user\Fonts” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “History” /d “D:\Documents and Settings\user\Local Settings\History” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Local AppData” /d “D:\Documents and Settings\user\Local Settings\Application Data” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Local Settings” /d “D:\Documents and Settings\user\Local Settings” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “NetHood” /d “D:\Documents and Settings\user\NetHood” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “PrintHood” /d “D:\Documents and Settings\user\PrintHood” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “Recent” /d “D:\Documents and Settings\user\Recent” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v “SendTo” /d “D:\Documents and Settings\user\SendTo” /f
echo 正在修改All Users
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “AppData” /d “D:\Documents and Settings\All Users\Local Settings\Application Data” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “CD Burning” /d “D:\Documents and Settings\All Users\Local Settings\Application Data\Microsoft\CD Burning” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Cookies” /d “D:\Documents and Settings\All Users\Cookies” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Fonts” /d “D:\Documents and Settings\All Users\Fonts” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “History” /d “D:\Documents and Settings\All Users\Local Settings\History” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Local AppData” /d “D:\Documents and Settings\All Users\Local Settings\Application Data” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Local Settings” /d “D:\Documents and Settings\All Users\Local Settings” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “NetHood” /d “D:\Documents and Settings\All Users\NetHood” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “PrintHood” /d “D:\Documents and Settings\All Users\PrintHood” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “Recent” /d “D:\Documents and Settings\All Users\Recent” /f
reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v “SendTo” /d “D:\Documents and Settings\All Users\SendTo” /f
echo.
echo 设置完成!建议立即重启!
echo.
echo 按任意键退出…
PAUSE >nul

感谢分享 这个有用