0
我发现这个有用的命令很好用。不过,我需要将它扩大到查找特定的文件类型使用批处理命令查找多个文件
>nul 2>nul dir /a-d "%OutputDirectory%\02_Processing.txt" "%OutputDirectory%\03_Proofs.txt" && (
mkdir "%ARCHIVE_FOLDER%\%DATETIMESTAMP%"
move "%OutputDirectory%\02_Processing.txt" "%ARCHIVE_FOLDER%\%DATETIMESTAMP%"
move "%OutputDirectory%\03_Proofs.txt" "%ARCHIVE_FOLDER%\%DATETIMESTAMP%"
move "%OutputDirectory%\04_Samples.txt" "%ARCHIVE_FOLDER%\%DATETIMESTAMP%"
echo Files moved to "%ARCHIVE_FOLDER%\%DATETIMESTAMP%"
) || (echo No file found)
到这样的事情
>nul 2>nul dir /a-d "folderName\file1" or file2 or file3 && (echo Files exist) || (echo No file found)
是否有可能在一个行做我需要把它分成多行。
您的文件名是否有格式? – dcg
不是。 File1是02_Process.txt,File2是03_Proof.txt,文件3是04_Sample.txt。但是,目录中可能有一个文件01_Convert.txt不能生效 –
如果没有模式只写'> nul 2> nul dir/ad“folderName \ file1”“folderName \ file2”“folderName \ file3”&&(echo文件存在)|| (echo没有找到文件)'看看会发生什么 – dcg