Click here to Skip to main content
15,886,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to copy an icon to the output folder:

copy $(ProjectDir)Images\Brand\ER\line2.ico $(TargetDir)


I get "The syntax of the command is incorrect."

This is what WAS there. It works. I'm trying to put it in the output folder:
if /I "$(ConfigurationName)" == "Release ER" copy $(ProjectDir)Images\Brand\ER\line2.ico $(ProjectDir)


What am I doing wrong here??

What I have tried:

Various syntax, all of which failed
Posted
Updated 17-Feb-23 9:04am
v2
Comments
Richard MacCutchan 18-Feb-23 4:09am    
Just add an "echo" command in front of the "copy" and you will see exactly what is generated.

Without knowing what TargetDir is, we can't be sure - but assuming that ProjectDir is identical for both commands I'd assume TargetDir contains spaces - if so then it needs to be enclosed in double quotes.
To be on the safe side, I'd use them on both paths:
copy "$(ProjectDir)Images\Brand\ER\line2.ico" "$(TargetDir)"
 
Share this answer
 
TargetDir is the full path to the Output folder. I've already tried this as will as $(OuDir) and it sill complains
 
Share this answer
 
Comments
Dave Kreskowiak 17-Feb-23 17:56pm    
You made the classic mistake of posting your reply to Griff as a solution to your own question. 'Griff never got an email saying you replied to him.

Next, the two commands you posted are not the same. Note the variable names at the end of each line:
copy $(ProjectDir)Images\Brand\ER\line2.ico $(TargetDir)

if /I "$(ConfigurationName)" == "Release ER" copy $(ProjectDir)Images\Brand\ER\line2.ico $(ProjectDir)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900