Windows命令从命令提示符下工作,但不是在CMD文件。知道为什么吗? [英] Windows command works from command prompt but not in cmd file. Any idea why?

查看:171
本文介绍了Windows命令从命令提示符下工作,但不是在CMD文件。知道为什么吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行一个批处理文件,下面的命令(我接到的这个答案),但它似乎并没有工作。然而,当我从一个cmd窗口中运行它,它运行良好。

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?

该命令;

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在这个时候意外。

任何帮助很多AP preciated

Any help is much appreciated

推荐答案

在您的批处理文件%F必须%% F。

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

这篇关于Windows命令从命令提示符下工作,但不是在CMD文件。知道为什么吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆