一键转移个人资料 v1.0
重装系统之后,我习惯在"一键GHOST备份系统"之前将个人资料永久转移到D盘,
目的很简单:避免"一键GHOST恢复系统"后,新近产生的个人资料丢失,另外,可以减小GHO体积。
个人资料包括:桌面、收藏夹、我的文档、共享文档、cookies,
本程序采用批处理方式制作,优点是:执行效率高、节省时间;开放源代码,便于分享、扩展与提高。
希望大家试用并提出宝贵意见.
有任何问题请 回复此贴,不要发新贴。
无忧论坛 DOS讨论区 版主 gmy 制作
2011.6.24
一键转移个人资料v1.0.bat 源代码- @echo off
- cls
- echo 欢迎使用 一键转移个人资料 v1.0
- echo.
- echo 转移的目标路径是
- echo D:\桌面
- echo D:\收藏夹
- echo D:\我的文档
- echo D:\共享文档
- echo D:\我的文档\cookies
- echo.
- echo 按任意键开始转移。
- pause >nul
- if not exist d:\ goto end
- md D:\桌面
- md D:\收藏夹
- md D:\我的文档
- md D:\共享文档
- md D:\我的文档\cookies
- REM 默认路径
- xcopy "C:\Documents and Settings\%USERNAME%\桌面\*.*" D:\桌面 /e /h /c /y
- xcopy "%ALLUSERSPROFILE%\桌面\*.*" D:\桌面 /e /h /c /y
- xcopy "C:\Documents and Settings\%USERNAME%\Favorites\*.*" D:\收藏夹 /e /h /c /y
- xcopy "%ALLUSERSPROFILE%\Favorites\*.*" D:\收藏夹 /e /h /c /y
- xcopy "C:\Documents and Settings\%USERNAME%\My Documents\*.*" D:\我的文档 /e /h /c /y
- xcopy "%ALLUSERSPROFILE%\Documents\*.*" D:\共享文档 /e /h /c /y
- xcopy "C:\Documents and Settings\%USERNAME%\cookies\*.*" D:\我的文档\cookies /e /h /c /y
- REM 兼容其它优化程序设置的路径
- xcopy "D:\My Documents\desktop\*.*" D:\桌面 /e /h /c /y
- xcopy "D:\My Documents\桌面\*.*" D:\桌面 /e /h /c /y
- xcopy "D:\desktop\*.*" D:\桌面 /e /h /c /y
- xcopy "D:\My Documents\Favorites\*.*" D:\收藏夹 /e /h /c /y
- xcopy "D:\My Documents\收藏夹\*.*" D:\收藏夹 /e /h /c /y
- xcopy "D:\Favorites\*.*" D:\收藏夹 /e /h /c /y
- xcopy "D:\My Documents\*.*" D:\我的文档 /e /h /c /y
- xcopy "D:\My Documents\cookies\*.*" D:\我的文档\cookies /e /h /c /y
- xcopy "D:\cookies\*.*" D:\我的文档\cookies /e /h /c /y
- regedit /s newdir.reg
- cls
- echo 执行完毕,重启才能生效,请关闭正在使用的其它软件,按任意键将重启电脑。
- pause >nul
- shutdown -r
- :end
复制代码 newdir.reg 源代码- Windows Registry Editor Version 5.00
- [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\DocFolderPaths]
- "Administrator"="D:\\我的文档"
- [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
- "Personal"="D:\\我的文档"
- "CommonPictures"="D:\\我的文档\\My Pictures"
- "CommonMusic"="D:\\我的文档\\My Music"
- "CommonVideo"="D:\\我的文档\\My Videos"
- "Common Favorites"="D:\\收藏夹"
- "Common Desktop"="C:\\Documents and Settings\\All Users\\桌面"
- "Common Documents"="D:\\共享文档"
- [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
- "Personal"="D:\\我的文档"
- "My Pictures"="D:\\我的文档\\My Pictures"
- "My Music"="D:\\我的文档\\My Music"
- "My Video"="D:\\我的文档\\My Videos"
- "Cookies"="D:\\我的文档\\Cookies"
- "Favorites"="D:\\收藏夹"
- "Desktop"="D:\\桌面"
- [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
- "Personal"=hex(2):44,00,3a,00,5c,00,11,62,84,76,87,65,63,68,00,00
- "CommonPictures"=hex(2):44,00,3a,00,5c,00,11,62,84,76,87,65,63,68,5c,00,4d,00,79,\
- 00,20,00,50,00,69,00,63,00,74,00,75,00,72,00,65,00,73,00,00,00
- "CommonMusic"=hex(2):44,00,3a,00,5c,00,11,62,84,76,87,65,63,68,5c,00,4d,00,79,00,\
- 20,00,4d,00,75,00,73,00,69,00,63,00,00,00
- "CommonVideo"=hex(2):44,00,3a,00,5c,00,11,62,84,76,87,65,63,68,5c,00,4d,00,79,00,\
- 20,00,56,00,69,00,64,00,65,00,6f,00,73,00,00,00
- "Common Favorites"=hex(2):44,00,3a,00,5c,00,36,65,cf,85,39,59,00,00
- "Common Desktop"=hex(2):25,00,41,00,4c,00,4c,00,55,00,53,00,45,00,52,00,53,00,\
- 50,00,52,00,4f,00,46,00,49,00,4c,00,45,00,25,00,5c,00,4c,68,62,97,00,00
- "Common Documents"=hex(2):44,00,3a,00,5c,00,71,51,ab,4e,87,65,63,68,00,00
- [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
- "Personal"=hex(2):44,00,3a,00,5c,00,11,62,84,76,87,65,63,68,00,00
- "My Pictures"=hex(2):44,00,3a,00,5c,00,11,62,84,76,87,65,63,68,5c,00,4d,00,79,\
- 00,20,00,50,00,69,00,63,00,74,00,75,00,72,00,65,00,73,00,00,00
- "My Music"=hex(2):44,00,3a,00,5c,00,11,62,84,76,87,65,63,68,5c,00,4d,00,79,00,\
- 20,00,4d,00,75,00,73,00,69,00,63,00,00,00
- "My Video"=hex(2):44,00,3a,00,5c,00,11,62,84,76,87,65,63,68,5c,00,4d,00,79,00,\
- 20,00,56,00,69,00,64,00,65,00,6f,00,73,00,00,00
- "Cookies"=hex(2):44,00,3a,00,5c,00,11,62,84,76,87,65,63,68,5c,00,43,00,6f,00,\
- 6f,00,6b,00,69,00,65,00,73,00,00,00
- "Favorites"=hex(2):44,00,3a,00,5c,00,36,65,cf,85,39,59,00,00
- "Desktop"=hex(2):44,00,3a,00,5c,00,4c,68,62,97,00,00
复制代码 下载地址见附件:
[ 本帖最后由 gmy 于 2011-6-24 16:08 编辑 ] |