English 中文(简体)
如何在批量档案中发表OR声明?
原标题:How to make a OR statement in a batch file?

然而,希望把2个或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

因此,如何补充,如果国家愿意在不想要执行的地方收集档案?

最佳回答

您可以链接到联合会;

FOR %%G IN (*.sql) DO (
   if not %%G==foo.sql if not %%G==bar.sql (
      some command "%%G"
   )
)
问题回答
@echo off
setlocal EnableDelayedExpansion
set unwantedFiles=foo bar baz
for %%g in (*.sql) do (
   set "test=!unwantedFiles:%%~Ng=!"
   if "!test!" == "!unwantedFiles!" (
      echo %%~Ng.sql is not unwanted, process it:
      echo Process with %%g
   )
)

姓名和复印不想要的物品 删除现有名称。 如果结果与以前相同,这个名字就属于不受欢迎的金融公司,因此处理。





相关问题
complex batch replacement linux

I m trying to do some batch replacement for/with a fairly complex pattern So far I find the pattern as: find ( -name *.php -o -name *.html ) -exec grep -i -n hello {} + The string I want ...

How to split a string by spaces in a Windows batch file?

Suppose I have a string "AAA BBB CCC DDD EEE FFF". How can I split the string and retrieve the nth substring, in a batch file? The equivalent in C# would be "AAA BBB CCC DDD EEE FFF".Split()[n]

How to check which Operating System?

How can I check OS version in a batch file or through a vbs in an Windows 2k/2k3 environment ? You know ... Something like ... : "If winver Win2k then ... or if winver Win2k3 then ....

热门标签