工作环境中的一段类似应用,仅供参考- for /f %%i in ('mountvol ^|find ":\"') do (
- setlocal enabledelayedexpansion
- set drv=%%i
- set drv=!drv:~0,1!
- if [%%i] NEQ [%~d0\] (
- if not exist !drv!:\Deploy (
- robocopy !drv!:\ .\Backup\%username%\!drv!_Drive /s /e /xj /xa:s /mt:15 /np /tee /njh /njs /v /log+:Backup\%username%\%username%_backuplog.log /r:0 /w:0 /xa:sh /xd config.msi boot $WINDOWS.~BT $RECYCLE.BIN "Documents and Settings" MSOCache ProgramData Recovery "System Volume Information" users Windows windows.old "Program Files" "Program Files (x86)" /xf pagefile.sys hiberfil.sys swapfile.sys
- attrib -s -h .\Backup\%username%\!drv!_Drive
- )
- )
- set drv=
- endlocal
- )
复制代码
|