gpt4 book ai didi

.net - Visual Studio 生成后事件 : for %f in (set) command

转载 作者:行者123 更新时间:2023-12-03 21:59:45 26 4
gpt4 key购买 nike

Visual Studio 2010 Post-build 事件中的这个命令

for %f in ("$(ProjectDir)$(OutDir)*.dll") do echo %f

( echo 将被其他工具替换)给我错误
The command "[...]" exited with code 255.

我想我必须逃避最外面的圆括号,但我不知道如何。我试过 \((( .

最佳答案

对于第一个(可能还有第二个),您可能需要使用 %%f 而不是 %f 。在批处理文件(VS 可能用于实现这些自定义构建步骤)中,您必须使用额外的 % 作为标识符。

编辑:这是 help for 输出的第一部分在命令行上。

Runs a specified command for each file in a set of files.

FOR %variable IN (set) DO command [command-parameters]

%variable Specifies a single letter replaceable parameter. (set) Specifies a set of one or more files. Wildcards may be used. command Specifies the command to carry out for each file. command-parameters Specifies parameters or switches for the specified command.

To use the FOR command in a batch program, specify %%variable instead of %variable. Variable names are case sensitive, so %i is different from %I.

关于.net - Visual Studio 生成后事件 : for %f in (set) command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5991692/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com