Windows command works from command prompt but not in cmd file. Any idea why?
I am trying to run the following command from a batch file (I go开发者_如何学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
The %f in your batch file needs to be %%f.
精彩评论