[英]Visual Studio Post-build event: for %f in (set) command
This command in the Visual Studio 2010 Post-build event Visual Studio 2010 Post-build事件中的此命令
for %f in ("$(ProjectDir)$(OutDir)*.dll") do echo %f
( echo
will be replaced with some other tool) gives me the error (
echo
将被其他一些工具取代)给我错误
The command "[...]" exited with code 255.
I guess I have to escape the outermost round brackets but I don't know how. 我想我必须逃离最外面的圆括号,但我不知道如何。 I tried
\\(
and ((
. 我试过
\\(
和((
。
You might need to use %%f instead of %f for the first one (and maybe the second one). 对于第一个(可能是第二个),您可能需要使用%% f而不是%f。 In a batch file (which VS might use to implement these custom build steps), you have to use the extra % for identifiers.
在批处理文件(VS可能用于实现这些自定义构建步骤)中,您必须使用额外的%作为标识符。
Edit: here's the first part of the output from help for
on the command line. 编辑:这是命令行
help for
输出的第一部分。
Runs a specified command for each file in a set of files.
为一组文件中的每个文件运行指定的命令。
FOR %variable IN (set) DO command [command-parameters]
FOR%变量IN(设置)DO命令[命令参数]
%variable Specifies a single letter replaceable parameter.
%variable指定单个字母可替换参数。 (set) Specifies a set of one or more files.
(set)指定一组一个或多个文件。 Wildcards may be used.
可以使用通配符。 command Specifies the command to carry out for each file.
command指定要为每个文件执行的命令。 command-parameters Specifies parameters or switches for the specified command.
command-parameters指定指定命令的参数或开关。
To use the FOR command in a batch program, specify %%variable instead of %variable.
要在批处理程序中使用FOR命令,请指定%% variable而不是%variable。 Variable names are case sensitive, so %i is different from %I.
变量名称区分大小写,因此%i与%I不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.