Post build event after VC generation

Requirement: Maybe we need to release a version to the artist, so we need *.exe, *.dll and resources all in one folder and then synchronize them to the artist
Problem: The.exe generated directory may not match the resource directory, so you can’t manually copy the generated.exe and DLL to the resource directory every time you compile the project

Solution: Use the build post batch command that comes with Visual Studio
visual studio-> Right-click project ->; properties-> Build Events-> Post-Build Event-> Under the Command Line

Xcopy $(OutDir) $(TargetFileName) $(ProjectDir.). \Resources

This imperative function copies the exe files in the build directory to the Resources folder one level above the project directory


$outDir = $outDir = $outDir = $outDir

2. Generate post-event xcopy is simply running a console command, so
Command does not support ‘/’

Like an error command written earlier

Xcopy $(OutDir) $(TargetFileName) $(ProjectDir.).
/ Resources \/Y

Runtime will prompt an error

3. “/Y” is a parameter, indicating that there is the same file to replace

You can also copy the entire folder

Xcopy “$(ProjectDir) controls,” “$(TargetDir).. \ app1 \ controls “/ y/I/e/exclude: CodeFilesToExclude. TXT

For specific parameters, refer to the CMD console to see the specific function of xcopy…

Read More: