3

I am trying to run the following command from a batch file (I got the idea from this answer), but it doesn't seem to work. Yet when I run it from a cmd window, it runs fine.

Can anyone explain why, and more importantly, what I can do about it?

The command is;

for %f in ("../Schema Objects/Schemas/dbo/Programmability/Stored Procedures/*.sql") do echo %f

The error I get when it's run from a batch file is;

f was unexpected at this time.

Any help is much appreciated

Community
  • 1
  • 1
Mr Moose
  • 5,946
  • 7
  • 34
  • 69

1 Answers1

4

The %f in your batch file needs to be %%f.

BillP3rd
  • 1,009
  • 1
  • 9
  • 21