无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
楼主: gmy
打印 上一主题 下一主题

一键转移个人资料 v1.0 (build 2011.06.24)

    [复制链接]
1#
发表于 2016-1-29 21:25:49 | 显示全部楼层
献个丑:
  1. @echo off
  2. title 命令提示符
  3. if "%1"=="/?" goto help
  4. if "%1"=="/h" goto help
  5. if "%1"=="/H" goto help
  6. if "%1"=="/u" goto original
  7. if "%1"=="/U" goto original
  8. title 转移系统资料文件夹的位置-向导
  9. :input
  10. cls
  11. echo 当前系统资料文件夹的名称及位置:
  12. echo.
  13. for /f "tokens=2*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Personal ^|findstr "Personal"') do set MD=%%b
  14. echo 『我的文档』
  15. if "%MD%"=="" set MD=%USERPROFILE%\My Documents
  16. echo %MD%
  17. echo.
  18. for /f "tokens=3*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music" ^|findstr "Music"') do set MM=%%b
  19. echo 『我的音乐』
  20. if "%MM%"=="" set MM=%USERPROFILE%\My Documents\My Music
  21. echo %MM%
  22. echo.
  23. for /f "tokens=3*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Video" 2^>nul^|findstr "Video"') do set MV=%%b
  24. echo 『我的视频』
  25. if "%MV%"=="" set MV=%USERPROFILE%\My Documents\My Videos
  26. echo %MV%
  27. echo.
  28. for /f "tokens=3*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Pictures" ^|findstr "Pictures"') do set MP=%%b
  29. echo 『图片收藏夹』
  30. if "%MP%"=="" set MP=%USERPROFILE%\My Documents\My Pictures
  31. echo %MP%
  32. echo.
  33. for /f "tokens=2*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Favorites ^|findstr "Favorites"') do set F=%%b
  34. echo 『收藏夹』
  35. if "%F%"=="" set F=%USERPROFILE%\Favorites
  36. echo %F%
  37. echo.
  38. for /f "tokens=2 delims={}" %%a in ('REG QUERY HKCU\Identities /v "Default User ID" 2^>nul^|findstr /i "Default"') do @set O=%%a
  39. for /f "tokens=3*" %%a in ('REG QUERY "HKCU\Identities\{%O%}\Software\Microsoft\Outlook Express\5.0" /v "Store Root" 2^>nul^|findstr "Store"') do @set OE=%%b
  40. echo 『Outlook Express』
  41. if "%OE%"=="" set OE=%USERPROFILE%\Local Settings\Application Data\Identities\{88888888-8888-8888-8888-888888888888}\Microsoft\Outlook Express\
  42. echo %OE%
  43. echo.
  44. set /P OK="请输入一个指令或目标驱动器:[H | Q | U | drive:] "
  45. if "%OK%"=="h" set h=1&goto help
  46. if "%OK%"=="H" set h=1&goto help
  47. if "%OK%"=="q" echo.&echo 正在退出. . .&call :ProcDelay 200&goto end
  48. if "%OK%"=="Q" echo.&echo 正在退出. . .&call :ProcDelay 200&goto end
  49. if "%OK%"=="u" goto original
  50. if "%OK%"=="U" goto original
  51. if not exist %OK%\nul goto input
  52. xcopy "%MD%\*.*" "%OK%\My Documents" /q /h /r /y>nul 2>nul
  53. xcopy "%F%\*.*" "%OK%\My Documents\Favorites" /s /q /h /r /y>nul 2>nul
  54. rd "%F%" /s /q>nul 2>nul
  55. :: xcopy "%MM%\*.*" "%OK%\My Documents\My Music" /s /q /h /r /y>nul 2>nul
  56. :: rd "%MM%" /s /q>nul 2>nul
  57. :: xcopy "%MP%\*.*" "%OK%\My Documents\My Pictures" /s /q /h /r /y>nul 2>nul
  58. :: rd "%MP%" /s /q>nul 2>nul
  59. xcopy "%MV%\*.*" "%OK%\My Documents\My Videos" /s /q /h /r /y>nul 2>nul
  60. rd "%MV%" /s /q>nul 2>nul
  61. xcopy "%OE%\*.*" "%OK%\My Documents\Outlook Express" /s /q /h /r /y>nul 2>nul
  62. rd "%OE%" /s /q>nul 2>nul
  63. rd "%MD%" /q>nul 2>nul
  64. reg delete "HKCU\Identities\{%O%}" /f>nul
  65. reg add "HKCU\Identities" /v "Default User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
  66. reg add "HKCU\Identities" /v "Last User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
  67. reg add "HKCU\Identities\{88888888-8888-8888-8888-888888888888}" /v "User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
  68. reg add "HKCU\Identities\{88888888-8888-8888-8888-888888888888}\Software\Microsoft\Outlook Express\5.0" /v "Store Root" /t REG_EXPAND_SZ /d "%OK%\My Documents\Outlook Express\" /f>nul
  69. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Favorites" /t REG_SZ /d "%OK%\My Documents\Favorites" /f>nul
  70. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music" /t REG_SZ /d "%OK%\My Documents\My Music" /f>nul
  71. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Pictures" /t REG_SZ /d "%OK%\My Documents\My Pictures" /f>nul
  72. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Video" /t REG_SZ /d "%OK%\My Documents\My Videos" /f>nul
  73. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal" /t REG_SZ /d "%OK%\My Documents" /f>nul
  74. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Favorites" /t REG_EXPAND_SZ /d "%OK%\My Documents\Favorites" /f>nul
  75. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Pictures" /t REG_EXPAND_SZ /d "%OK%\My Documents\My Pictures" /f>nul
  76. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /t REG_EXPAND_SZ /d "%OK%\My Documents" /f>nul
  77. echo.
  78. echo 文件夹内容已经转移,注册表信息已经更改,重新启动后生效!
  79. call :ProcDelay 400
  80. goto end
  81. :original
  82. reg add "HKCU\Identities" /v "Default User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
  83. reg add "HKCU\Identities" /v "Last User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
  84. reg add "HKCU\Identities\{88888888-8888-8888-8888-888888888888}" /v "User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
  85. reg add "HKCU\Identities\{88888888-8888-8888-8888-888888888888}\Software\Microsoft\Outlook Express\5.0" /v "Store Root" /t REG_EXPAND_SZ /d "%USERPROFILE%\Local Settings\Application Data\Identities\{88888888-8888-8888-8888-888888888888}\Microsoft\Outlook Express\" /f>nul
  86. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Favorites" /t REG_SZ /d "%USERPROFILE%\Favorites" /f>nul
  87. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music" /t REG_SZ /d "%USERPROFILE%\My Documents\My Music" /f>nul
  88. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Pictures" /t REG_SZ /d "%USERPROFILE%\My Documents\My Pictures" /f>nul
  89. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Video" /t REG_SZ /d "%USERPROFILE%\My Documents\My Videos" /f>nul
  90. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal" /t REG_SZ /d "%USERPROFILE%\My Documents" /f>nul
  91. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Favorites" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\Favorites" /f>nul
  92. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Pictures" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\My Documents\My Pictures" /f>nul
  93. reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\My Documents" /f>nul
  94. if not "%MD%"=="%USERPROFILE%\My Documents" xcopy "%MD%\*.*" "%USERPROFILE%\My Documents" /q /h /r /y>nul 2>nul
  95. if not "%F%"=="%USERPROFILE%\Favorites" xcopy "%F%\*.*" "%USERPROFILE%\Favorites" /s /q /h /r /y>nul 2>nul
  96. if not "%F%"=="%USERPROFILE%\Favorites" rd "%F%" /s /q>nul 2>nul
  97. :: if not "%MM%"=="%USERPROFILE%\My Documents\My Music" xcopy "%MM%\*.*" "%USERPROFILE%\My Documents\My Music" /s /q /h /r /y>nul 2>nul
  98. :: if not "%MM%"=="%USERPROFILE%\My Documents\My Music" rd "%MM%" /s /q>nul 2>nul
  99. :: if not "%MP%"=="%USERPROFILE%\My Documents\My Pictures" xcopy "%MP%\*.*" "%USERPROFILE%\My Documents\My Pictures" /s /q /h /r /y>nul 2>nul
  100. :: if not "%MP%"=="%USERPROFILE%\My Documents\My Pictures" rd "%MP%" /s /q>nul 2>nul
  101. if not "%MV%"=="%USERPROFILE%\My Documents\My Videos" xcopy "%MV%\*.*" "%USERPROFILE%\My Documents\My Videos" /s /q /h /r /y>nul 2>nul
  102. if not "%MV%"=="%USERPROFILE%\My Documents\My Videos" rd "%MV%" /s /q>nul 2>nul
  103. if not "%OE%"=="%USERPROFILE%\Local Settings\Application Data\Identities\{88888888-8888-8888-8888-888888888888}\Microsoft\Outlook Express" xcopy "%OE%\*.*" "%USERPROFILE%\Local Settings\Application Data\Identities\{88888888-8888-8888-8888-888888888888}\Microsoft\Outlook Express" /s /q /h /r /y>nul 2>nul
  104. if not "%OE%"=="%USERPROFILE%\Local Settings\Application Data\Identities\{88888888-8888-8888-8888-888888888888}\Microsoft\Outlook Express" rd "%OE%" /s /q>nul 2>nul
  105. if not "%MD%"=="%USERPROFILE%\My Documents" rd "%MD%" /q>nul 2>nul
  106. echo.
  107. echo 注册表信息已经恢复,文件夹内容已经转移,重新启动后生效!
  108. call :ProcDelay 400
  109. goto end
  110. :help
  111. if "%h%"=="1" echo.
  112. echo 转移系统资料文件夹的位置。
  113. echo.
  114. echo DATAMOVE [drive:] [/U] [/Q] [/H]
  115. echo.
  116. echo   drive:  指定要转移到的目标驱动器
  117. echo   /U      恢复系统默认值
  118. echo   /Q      向导中退出
  119. echo   /H      显示帮助信息
  120. echo.
  121. echo 不加任何参数键入 DATAMOVE,可以启动一个向导。
  122. echo.
  123. echo 目标驱动器将自动添加文件夹路径 My Documents。
  124. echo.
  125. echo 命令行开关 /U 会将更改过的系统注册表信息还原。
  126. echo 它不会还原回您之前已更改系统的任何值,而直接
  127. echo 还原回系统的默认值。
  128. echo.
  129. if "%h%"=="1" pause&set h=&goto input
  130. goto end

  131. :ProcDelay number
  132. Setlocal EnableExtensions
  133. for /f "tokens=1-4 delims=:. " %%h in ("%TIME%") do set start_=%%h%%i%%j%%k
  134.      :wait_
  135.      for /f "tokens=1-4 delims=:. " %%h in ("%TIME%") do set now_=%%h%%i%%j%%k
  136.      set /a diff_=%now_%-%start_%
  137. if %diff_% lss %1 goto wait_
  138. Endlocal

  139. :end
  140. set MD=
  141. set MM=
  142. set MV=
  143. set MP=
  144. set F=
  145. set O=
  146. set OE=
  147. set OK=
  148. set h=
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-12 16:38

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表