|
本帖最后由 cii09 于 2023-6-13 15:15 编辑
[已解决]c盘个人资料转移脚本读txt配置支持通配符.快速启动,开始菜单固定,任务栏固定
这个脚本读txt使用不了通配符需要改哪里.个人资料转移,快速启动,菜单菜单固定,任务栏固定.
配合这个用的 ,有些固定位置改注册表或者使用硬链接都会有兼容性问题,单独备份还原最妥帖,这个脚本没法用通配符不方便整合进计划任务.
- @echo off&setlocal EnableDelayedExpansion
- ::Code by gool123456 @ 2010 On BBS.cn-DOS.net
- echo ==========今天是:%date%=============
- echo.
- if exist dirlist.txt (goto :TXT) else (
- set /p folder_=拖入要备份的文件夹并回车:
- call :task
- set folder=!folder_:"=!
- set "mm=!folder:\=,!"
- set "mm=!mm: =:!"
- for %%e in (!mm!) do set "mm_=%%e"
- set "mm_=!mm_::= !"
- md ".\!date_!\!mm_!" 2>nul
- Xcopy !folder_! ".\!date_!\!mm_!" /e /y
- )
- pause
- >>.\!date_!\dirlist.txt echo !folder!
- goto :eof
- :TXT
- for /f "delims=" %%a in (dirlist.txt) do (
- call :task
- set "folder=%%a"
- set "mm=!folder:\=,!"
- set mm=!mm: =:!
- for %%e in (!mm!) do set "mm_=%%e"
- set "mm_=!mm_::= !
- md ".\!date_!\!mm_!"
- Xcopy "%%a" ".\!date_!\!mm_!" /e /y
- )
- pause
- copy /y dirlist.txt ".\!date_!" >nul
- goto :eof
- :task
- for /f "delims= " %%i in ('echo %date%') do set "date_=%%i"
- set "date_=%date_:-=%"
- if not exist ".\%date_%" md ".\%date_%"
- goto :eof
复制代码 \
- @echo off & setlocal EnableDelayedExpansion
- ::Code by gool123456 @ 2010 On BBS.cn-DOS.net
- ::恢复今天备份的文件夹
- for /f "delims= " %%i in ('echo %date%') do set "date_=%%i"
- set "date_=%date_:-=%"
- if exist ".\%date_%" (
- cd /d ".\%date_%"
- if exist dirlist.txt (
- for /f "delims=" %%c in (dirlist.txt) do (
- set "folder=%%c"
- set "mm=!folder:\=,!"
- set mm=!mm: =:!
- for %%e in (!mm!) do set "mm_=%%e"
- set "mm_=!mm_::= !
- if exist "!mm_!" (
- if not exist "%%c" MD "%%c"
- Xcopy "!mm_!" "%%c" /y /e
- )
- )
- ) else (echo 缺失列表文件:dirlist.txt&pause>nul&goto :eof)
- echo.&echo 成功恢复&pause>nul
- ) else (echo 没有今天可恢复的文件夹&pause>nul)
- goto :eof
复制代码
- %USERPROFILE%\AppData\Local\Microsoft\Windows\History
- %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Network Shortcuts
- %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
- %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent
- %USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo
- %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
- %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Templates
- %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Libraries
- %USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch
- %USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\ImplicitAppShortcuts
- %USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\Search
- %USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\StartMenu
- %USERPROFILE%\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
复制代码
使用固定路径可以用
麻烦看一下这个脚本读txt用不了%USERPROFILE%通配符需要改哪里
用了好久的原版
BackupRestoreBat4ini_v1.1_wuyou.net.zip
(1.48 KB, 下载次数: 30)
txt配置支持环境变量(感谢batche的帮助)
BackupRestoreBat4ini_v1.21.zip
(1.5 KB, 下载次数: 32)
|
|