本帖最后由 ygqiang 于 2021-12-1 15:02 编辑
[已解决]批处理,同步备份文件,如何判断特殊情况?
如果目标同步目录,都不存在,如何判断并加上下面的代码?- @echo off & setlocal enabledelayedexpansion
- for %%i in (E F G H I J K L M N O P Q R S T U V W X Y Z) do (
- if exist %%i:\ (
- set "panf=%%i"
- if exist !panf!:\mubi-BBBB (
- call :Next
- )
- )
-
- )
- cls
- exit
-
-
-
-
- :Next
- cls
-
- echo 源目录:D:\yuan-aaaa
- echo 同步目录:!panf!:\mubi-BBBB
- pause >nul 2>nul
-
-
- (
- echo [pathsync settings]
- echo pssversion=1
- echo path1=D:\yuan-aaaa
- echo path2=!panf!:\mubi-BBBB
- echo ignflags=0
- echo defbeh=3
- echo logpath=
- echo include=
- echo throttlespd=1024
- echo throttle=0
- echo syncfolders=1
- )>d-!panf!.pss
-
- pause >nul 2>nul
-
-
- pathsync绿色中文.exe /loadpss ".\d-!panf!.pss" -autorun
- cls
- echo 同步完毕
- pause >nul 2>nul
-
- goto :eof
复制代码
- cls
- echo 没有符合条件的同步盘
- pause >nul 2>nul
- exit
复制代码
|