一、生成文件复制一份到其他路径
 选到这里,添加命令:
PlatformName 平台版本  x86/x64
 Configuration 配置生成目录 Debug/Release
 OutputPath 生成路径  Debug/Release
 copy /y "$(OutputPath)$(ProjectName).dll"  "E:\Project\UseDll\$(Configuration)"
 复制$输出目录(即:debug/release目录)$项目名.xx后缀文件 到你要的一个目录下。也可以直接写对应的绝对路径

二、VS IDE中常用路径 表示
 $(SolutionDir) 即解决方案配置文件 xxx.sln所在的目录
$(ProjectDir) 表示 xxx.vcxproj所在的目录 
 例如:D:\WorkSpace\CPPWorkSpace\TestDLL\DLL2\
$(ProjectName) 代表具体的project 名称,例如一个解决方案下,每一个工程都有各自的名称
$(Configuration) 代表Debug或者Release
三、
copy "$(TargetDir)$(TargetName).lib" ..\lib\deploy\$(TargetName).lib
编译完成后将一个.lib 文件拷贝到指定目录
 Post-Build Event command line
在vs2003 和2005中都支持了Build Events(编译生成事件), 但是2003只支持单行的命令,而2005可以支持多行命令.
要想在2003中执行多行命令,只能把命令写在一个批处理文件中,然后通过调用批处理来执行.
1.在Solution explorer中用context meun查看project的property.
2.选择Build Events,可以看到Pre-build 和Post-build event command line,以及运行Post-build event 的条件
//——————————————————
用法收集
1.build完后修改build产物的名字(后缀),并覆盖已有的同名文件.
copy $(TargetFileName) $(TargetName).XXX y
2. 调用外部命令或批处理:
call "C:\Program Files\XXX.exe"
3. 条件判断:
IF NOT $(ConfigurationName) == Release GOTO end
call "C:\Program Files\XXX.exe" $(ProjectDir)$(TargetName).cvp
:end
4.web project 自动部署
copy     $(TargetDir)*.*     \\MyServer\MyService\bin
 copy     $(ProjectDir)*.ascx     
5. copy from one path to the other path
Copy "$(ProjectDir)pri.bin" "$(SolutionDir)$(SolutionName)\$(OutDir)"
copy pri.bin(file name) from $(ProjectDir) to $(SolutionDir)$(SolutionName)\$(OutDir)
//——————————————————
Macro收集
$(DevEnvDir)
$(ProjectDir)
$(BuiltOuputPath)
$(ConfigurationName)
$(TargetName) 不含扩展名
$(TargetFileName) 包含扩展名



















