如何在批处理文件中创建 OR 语句?
您好,想从我的批处理文件中排除 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
那么,我如何添加 if 语句来跳过循环中我不想执行的文件?
Hi want to exclude 2 or more files from my batch file.
My batch file executes all SQL
files in that folder.
Here is the code:
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
So, how would i add and if statemant to skip the files in the loop that i don't want to execute?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以链接 IF;
You can chain IFs;
取一个名称并通过删除当前名称来复制unknownFiles。如果结果与之前相同,则该名称不在unknownFiles中,因此对其进行处理...
Take a name and copy unwantedFiles by removing current name. If the result is the same as before, this name is NOT in unwantedFiles, so process it...