• 欢迎访问奇跡の海网站,本站不上传任何资源,所有资源均来自于网络,欢迎加入奇跡の海~!奇跡の海-WordPress QQ群
  • 本站下载资源为网络上收集整理而来,并且以计算机技术研究交流为目的,版权归原作者所有,仅供大家参考,学习,不存在任何商业目的与商业用途.
  • 本站系统镜像均来自于官方原版,ed2k可视为P2P下载链接。所有操作系统默认均为试用版,如有正版密钥可以有效激活,本站不提供任何激活和相关服务。

复制并转移系统资料文件夹向导 BAT 批处理

批处理 奇跡の海 2年前 (2017-02-18) 443次浏览 已收录 0个评论 扫描二维码

复制并转移系统资料文件夹向导 BAT 批处理

        可以帮助您让我们把桌面、我的文档、收藏夹等比较常用于保存资料文件的系统文件夹转移到其它分区。

一般用于系统重新安装,系统还原,对桌面或者我的文档里的资料进行备份的工具。

@echo off
title 命令提示符
if "%1"=="/?" goto help
if "%1"=="/h" goto help
if "%1"=="/H" goto help
if "%1"=="/u" goto original
if "%1"=="/U" goto original
:: for /f "tokens=2*" %%a in ('reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v ProductName 2^>nul^|findstr "Microsoft"') do @set V=%%b
:: if "%V%"=="" echo This program cannot be run in DOS mode.
:: goto end
title 复制并转移系统资料文件夹向导
:input
cls
echo 当前系统资料文件夹名称及位置。
echo.
for /f "tokens=2*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Personal ^|findstr "Personal"') do @set MD=%%b
echo 『我的文档』
if "%MD%*"=="*" set MD=%USERPROFILE%\My Documents
echo %MD%
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
echo 『我的音乐』
if "%MM%*"=="*" set MM=%USERPROFILE%\My Documents\My Music
echo %MM%
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
echo 『我的视频』
if "%MV%*"=="*" set MV=%USERPROFILE%\My Documents\My Videos
echo %MV%
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
echo 『图片收藏夹』
if "%MP%*"=="*" set MP=%USERPROFILE%\My Documents\My Pictures
echo %MP%
for /f "tokens=2*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Favorites ^|findstr "Favorites"') do @set F=%%b
echo 『收藏夹』
if "%F%*"=="*" set F=%USERPROFILE%\Favorites
echo %F%
:: 传真
:: HKLM\SOFTWARE\Microsoft\Fax
:: HKLM\SOFTWARE\Microsoft\Fax\ActivityLogging
:: DBFile=%ALLUSERSPROFILE%\Application Data\Microsoft\Windows NT\MSFax\ActivityLog
:: HKLM\SOFTWARE\Microsoft\Fax\Inbox
:: Folder=%ALLUSERSPROFILE%\Application Data\Microsoft\Windows NT\MSFax\Inbox
:: HKLM\SOFTWARE\Microsoft\Fax\SentItems
:: Folder=%ALLUSERSPROFILE%\Application Data\Microsoft\Windows NT\MSFax\SentItems
::
for /f "tokens=2*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache ^|findstr "Temporary"') do @set Ca=%%b
echo 『Cache』
if "%Ca%*"=="*" set Ca=%USERPROFILE%\Local Settings\Temporary Internet Files
echo %Ca%
for /f "tokens=2*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cookies ^|findstr "Cookies"') do @set Co=%%b
echo 『Cookies』
if "%Co%*"=="*" set Co=%USERPROFILE%\Cookies
echo %Co%
for /f "tokens=2*" %%a in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v History ^|findstr "History"') do @set H=%%b
echo 『History』
if "%H%*"=="*" set H=%USERPROFILE%\Local Settings\History
echo %H%
for /f "tokens=2 delims={}" %%a in ('REG QUERY HKCU\Identities /v "Default User ID" 2^>nul^|findstr /i "Default"') do @set O=%%a
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
echo 『Outlook Express』
if "%OE%*"=="*" set OE=%USERPROFILE%\Local Settings\Application Data\Identities\{88888888-8888-8888-8888-888888888888}\Microsoft\Outlook Express\
echo %OE%
for /f "tokens=2*" %%a in ('REG QUERY "HKCU\Environment" /v TEMP ^|findstr "TEMP"') do @set T=%%b
echo 『TEMP』
if "%T%*"=="*" set T=%%USERPROFILE%%\Local Settings\Temp
echo %T%
echo.
set /P OK="请输入一个指令或目标驱动器:[H | Q | U | drive:] "
if "%OK%"=="h" set h=1&&goto help
if "%OK%"=="H" set h=1&&goto help
if "%OK%"=="q" echo.&&echo 正在退出. . .&&call :ProcDelay 200&&goto end
if "%OK%"=="Q" echo.&&echo 正在退出. . .&&call :ProcDelay 200&&goto end
if "%OK%"=="u" goto original
if "%OK%"=="U" goto original
if not exist %OK%\nul goto input
if exist "%MD%\nul" xcopy "%MD%\*.*" "%OK%\My Documents" /i /q /h /r /y >nul 2>nul
if exist "%Co%\nul" xcopy "%Co%\*.*" "%OK%\My Documents\Cookies" /s /i /q /h /r /y >nul 2>nul
if exist "%F%\nul" xcopy "%F%\*.url" "%OK%\My Documents\Favorites" /s /i /q /h /r /y >nul 2>nul
if exist "%H%\nul" xcopy "%H%\*.*" "%OK%\My Documents\History" /s /i /q /h /r /y >nul 2>nul
if exist "%MM%\nul" xcopy "%MM%\*.*" "%OK%\My Documents\My Music" /s /i /q /h /r /y >nul 2>nul
if exist "%MP%\nul" xcopy "%MP%\*.*" "%OK%\My Documents\My Pictures" /s /i /q /h /r /y >nul 2>nul
if exist "%MV%\nul" xcopy "%MV%\*.*" "%OK%\My Documents\My Videos" /s /i /q /h /r /y >nul 2>nul
if exist "%OE%\nul" xcopy "%OE%\*.*" "%OK%\My Documents\Outlook Express" /s /i /q /h /r /y >nul 2>nul
if exist "%Ca%\nul" xcopy "%Ca%\*.*" "%OK%\My Documents\Temporary Internet Files" /s /i /q /h /r /y >nul 2>nul
reg delete "HKCU\Identities\{%O%}" /f>nul
reg add "HKCU\Environment" /v "TEMP" /t REG_EXPAND_SZ /d "%OK%\My Documents\Temp" /f>nul
reg add "HKCU\Environment" /v "TMP" /t REG_EXPAND_SZ /d "%OK%\My Documents\Temp" /f>nul
reg add "HKCU\Identities" /v "Default User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
reg add "HKCU\Identities" /v "Last User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
reg add "HKCU\Identities\{88888888-8888-8888-8888-888888888888}" /v "User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
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
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Cache" /t REG_SZ /d "%OK%\My Documents\Temporary Internet Files" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Cookies" /t REG_SZ /d "%OK%\My Documents\Cookies" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Favorites" /t REG_SZ /d "%OK%\My Documents\Favorites" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "History" /t REG_SZ /d "%OK%\My Documents\History" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music" /t REG_SZ /d "%OK%\My Documents\My Music" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Pictures" /t REG_SZ /d "%OK%\My Documents\My Pictures" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Video" /t REG_SZ /d "%OK%\My Documents\My Videos" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal" /t REG_SZ /d "%OK%\My Documents" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Cache" /t REG_EXPAND_SZ /d "%OK%\My Documents\Temporary Internet Files" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Cookies" /t REG_EXPAND_SZ /d "%OK%\My Documents\Cookies" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Favorites" /t REG_EXPAND_SZ /d "%OK%\My Documents\Favorites" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "History" /t REG_EXPAND_SZ /d "%OK%\My Documents\History" /f>nul
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
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /t REG_EXPAND_SZ /d "%OK%\My Documents" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths" /v "Directory" /t REG_SZ /d "%OK%\My Documents\Temporary Internet Files\Content.IE5" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path1" /v "CachePath" /t REG_SZ /d "%OK%\My Documents\Temporary Internet Files\Content.IE5\Cache1" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path2" /v "CachePath" /t REG_SZ /d "%OK%\My Documents\Temporary Internet Files\Content.IE5\Cache2" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path3" /v "CachePath" /t REG_SZ /d "%OK%\My Documents\Temporary Internet Files\Content.IE5\Cache3" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path4" /v "CachePath" /t REG_SZ /d "%OK%\My Documents\Temporary Internet Files\Content.IE5\Cache4" /f>nul
echo.
echo 文件夹内容已经复制;注册表信息已经更改,重新启动后生效!
call :ProcDelay 400
goto end
:original
reg add "HKCU\Environment" /v "TEMP" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\Local Settings\Temp" /f>nul
reg add "HKCU\Environment" /v "TMP" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\Local Settings\Temp" /f>nul
reg add "HKCU\Identities" /v "Default User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
reg add "HKCU\Identities" /v "Last User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
reg add "HKCU\Identities\{88888888-8888-8888-8888-888888888888}" /v "User ID" /t REG_SZ /d "{88888888-8888-8888-8888-888888888888}" /f>nul
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
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Cache" /t REG_SZ /d "%USERPROFILE%\Local Settings\Temporary Internet Files" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Cookies" /t REG_SZ /d "%USERPROFILE%\Cookies" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Favorites" /t REG_SZ /d "%USERPROFILE%\Favorites" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "History" /t REG_SZ /d "%USERPROFILE%\Local Settings\History" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music" /t REG_SZ /d "%USERPROFILE%\My Documents\My Music" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Pictures" /t REG_SZ /d "%USERPROFILE%\My Documents\My Pictures" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Video" /t REG_SZ /d "%USERPROFILE%\My Documents\My Videos" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal" /t REG_SZ /d "%USERPROFILE%\My Documents" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Cache" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\Local Settings\Temporary Internet Files" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Cookies" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\Cookies" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Favorites" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\Favorites" /f>nul
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "History" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\Local Settings\History" /f>nul
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
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /t REG_EXPAND_SZ /d "%%USERPROFILE%%\My Documents" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths" /v "Directory" /t REG_SZ /d "%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path1" /v "CachePath" /t REG_SZ /d "%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5\Cache1" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path2" /v "CachePath" /t REG_SZ /d "%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5\Cache2" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path3" /v "CachePath" /t REG_SZ /d "%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5\Cache3" /f>nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Paths\path4" /v "CachePath" /t REG_SZ /d "%USERPROFILE%\Local Settings\Temporary Internet Files\Content.IE5\Cache4" /f>nul
echo.
echo 注册表信息已经恢复,重新启动后生效!
call :ProcDelay 400
goto end
:help
if "%h%"=="1" echo.
echo 复制并转移系统资料文件夹。
echo.
echo DATAMOVE [drive:] [/U] [/Q] [/H]
echo.
echo   drive:  指定您想转移到的目标驱动器
echo   /U      恢复系统默认值
echo   /Q      向导中退出
echo   /H      显示帮助信息
echo.
echo 不加任何参数键入 DATAMOVE,可以启动一个向导。
echo.
echo 目标驱动器将自动添加文件夹路径 My Documents。
echo.
echo 命令行开关 /U 会将更改过的系统注册表信息还原。
echo 它不会还原回您之前已更改系统的任何值,而直接
echo 还原回系统的默认值。
echo.
if "%h%"=="1" pause&&set h=&&goto input
goto end

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

:end
set MD=
set MM=
set MV=
set MP=
set F=
set Ca=
set Co=
set H=
set O=
set OE=
set T=
set OK=

版权声明:本站所有文章和资源使用CC BY-NC-SA 4.0协议授权发布 , 转载应当以相同方式注明文章来自“SeaOMC.COM->复制并转移系统资料文件夹向导 BAT 批处理!在下边可以分享本文哦!
喜欢 (0)
[]
分享 (0)
奇跡の海
关于作者:
一个WordPress菜鸟!
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址