嗨,想从我的批处理文件中排除 2 个或更多文件。
我的批处理文件执行所有 SQL
该文件夹中的文件。
这是代码:
ECHO %USERNAME% started the batch process at %TIME% >output.txt
FOR %%G IN (*.sql) DO (
//IF would go here to skip unwanted files
sqlcmd.exe -S RMSDEV7 -E -d ChaseDataMedia7 -i "%%G" >>output.txt
)
pause
那么,我将如何添加以及如果 statemant 跳过循环中我不想执行的文件?
最佳答案
您可以链接 IF;
FOR %%G IN (*.sql) DO (
if not %%G==foo.sql if not %%G==bar.sql (
some command "%%G"
)
)
关于command-line - 如何在批处理文件中创建 OR 语句?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8849425/