Visual Studio Command Line Event Command Line for Syntax

Solution1 : { Project1 (window form), Project2 (class library)}

Trying to copy all the DLL files that I get after compiling Project1 from the default directory (same as .exe) to the /lib subfolder.

 if not exist Lib mkdir Lib for %i in (*.dll) move /Y "$(TargetDir)%i" "$(TargetDir)Lib\%i" 

I have a problem with the syntax for %i in (*.dll) . What is the right way to do this?

Note. This will not give errors (but it only copies 1.dll, and not all):

 if not exist Lib mkdir Lib move /Y "$(TargetDir)first.dll" "$(TargetDir)Lib\first.dll" 
+5
source share
1 answer
You were almost there. You should use double percent %% and do :
 for %%i in (*.dll) do move /Y "$(TargetDir)%%i" "$(TargetDir)Lib\%%i" 
+4
source

All Articles