-2

I execuet the below batch to get my script "mvn.bat" to execute on all the folders under a directory. As you see the for loop considers "*" as input and this all folders are considered for execution.

FOR /D %%G in ("*") DO (
    D:\maven\bin\mvn.bat jcli:deploy -Dlist.dir="./%%G" -Denv.name=Server1 -Dint.service=Server service
)

I now wanted the script to ignore folders that ends with Shared (condition "*Shared"), i tried several ways putting if loop to filter and etc,, but nothing worked out, any sugeestion or solution will be helpful..

Nir Alfasi
  • 53,191
  • 11
  • 86
  • 129

1 Answers1

0

Its hard to tell what you are really asking but I think you cannot do that in a DOS batch script but you can do that in C# or Powershell possibly. Your clue can be found here ?

Community
  • 1
  • 1
djangofan
  • 28,471
  • 61
  • 196
  • 289
  • I think i miscommunicated, I wanted the loop to exclue folders with the name '*shared' and they are not really a shared folders – user1515853 Jul 12 '12 at 00:33