echo "1 Copy inc to Test dir"
copy .\TestDll\Error.h ..\..\Driver\TestProject\Test\inc
copy .\TestDll\Base.h ..\..\Driver\TestProject\Test\inc
copy .\TestDll\TestDll.h ..\..\Driver\TestProject\Test\inc
echo "2 Copy 32 bit dll to Test dir"
copy .\Release\TestDll.dll ..\..\Driver\TestProject\Test\lib
copy .\Release\TestDll.lib ..\..\Driver\TestProject\Test\lib
echo "3 Copy 64 bit dll to Test dir"
copy .\x64\Release\TestDll.dll ..\..\Driver\TestProject\Test\lib_x64
copy .\x64\Release\TestDll.lib ..\..\Driver\TestProject\Test\lib_x64
pause
如上图,开发过程中,我们可能会编译32位和64位的DLL库,在另外的一个工程的exe可能用到这些库的头文件以及编译后的dll。
如果每次修改了DLL工程都需要手动拷贝,那么就太麻烦了,直接编写一个bat脚本拷贝,防止遗漏拷贝而且操作简单,只需点击运行就可以。
bat脚本中.\表示当前目录。..\表示上一级目录。