Post built event copy exe file or dll file to another project by command line, mainly we will focus on "$(TargetDir)" and "$(TargetName)" to copy specific file.
Now with this code snippet we are going to copy exe file to another project location. However, just in case if you want to copy multi location copy the same line to different directory
"$(TargetDir) returns the path of bin folder inside the solution it can be either Debug or Release folder based on the built configuration Active setup in Microsoft Visual Studio.
$(TargetName) returns file name of specific exetention most case it will be .dll or .exe.
Example Source Snippets - PostBuiltEvent.zip
copy "$(TargetDir)$(TargetName).exe" "C:\jack\code\Folder1\"
copy "$(TargetDir)$(TargetName).exe" "C:\jack\code\Folder1\" copy "$(TargetDir)$(TargetName).exe" "C:\jack\code\Folder2\"
smartsnipps.ecomparefiles.com © 2021, All Rights Reserved | Disclaimer: smartsnipps.eCompareFiles.com is free to use any code snippets without guarantee