• 歡迎訪問奇跡の海網站,本站不上傳任何資源,所有資源均來自于網絡,歡迎加入奇跡の海~!奇跡の海-WordPress QQ群
  • 本站下載資源為網絡上收集整理而來,并且以計算機技術研究交流為目的,版權歸原作者所有,僅供大家參考,學習,不存在任何商業目的與商業用途.
  • 本站系統鏡像均來自于官方原版,ed2k可視為P2P下載鏈接。所有操作系統默認均為試用版,如有正版密鑰可以有效激活,本站不提供任何激活和相關服務。

復制并轉移系統資料文件夾向導 BAT 批處理

批處理 奇跡の海 3年前 (2017-02-18) 575次瀏覽 已收錄 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,您需要填寫昵稱和郵箱!

  • 昵稱 (必填)
  • 郵箱 (必填)
  • 網址
中国福利彩票36选7开奖结果