使用bat脚本编译VS工程
来源:互联网 发布:仓库存储储位优化 编辑:程序博客网 时间:2024/06/05 08:16
一直以为devenv.exe是个gui编译工具,没想到还支持命令行下编译。命令行形式如下:
devenv.exe 解决方案名.sln /rebuild "平台(Win32/x64)|配置(Debug/Release)"
例如,我在C盘下有个名为test的解决方案,要编译出x86/x64平台的Debug/Release,一共4种类型的代码。那可以在test解决方案的同层目录下建立一个编译脚本,之后双击运行等待编译完成即可:
set devnev="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"%devnev% %cd%\bld.sln /rebuild "Debug|win32"%devnev% %cd%\bld.sln /rebuild "Debug|x64"%devnev% %cd%\bld.sln /rebuild "Release|win32"%devnev% %cd%\bld.sln /rebuild "Release|x64"
当然,这并不比直接在IDE中编译方便多少。最后贴出一个项目中用到的脚本
@echo **************************************************@echo * *@echo * System Driver *@echo * *@echo **************************************************@rem Set Project Path@set Current_path = %cd%@Set BtMon_Path = %cd%/Toshiba_System_Driver/BtMon_SystemDriver_0725@Set RMService_path =@Set TabSysSvc_path =@Set tosrfec_path =@Set TosSysHID_path =@Set TVALZ_path =@Set TosQnt_path =@Set VS2010_BuildTool_path = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"@echo === Starting to Build System Driver for WinXP Win8 Win10 ===@echo 1.Building BtMon......@devenv.exe %cd%\BtMon_SystemDriver_0725\BtMon\BtMon\BtMon\BtMon.sln /rebuild "release|Win32"@rem devenv.exe %cd%\BtMon_SystemDriver_0725\BtMon\BtMon\BtMon\BtMon.sln /rebuild "release|Win32" /out "C:\Test-build\BuildLog.txt"@devenv.exe %cd%\BtMon_SystemDriver_0725\BtMon\BtMon\BtMon4\BtMon2.sln /rebuild "release|Win32"@devenv.exe %cd%\BtMon_SystemDriver_0725\BtMon\BtMon\BtMon4\BtMon2.sln /rebuild "release|x64"@devenv.exe %cd%\BtMon_SystemDriver_0725\BtMon\DrvInst\DrvInst.sln /rebuild "release|Win32@devenv.exe %cd%\BtMon_SystemDriver_0725\BtMon\TosBthSupport_ForMSStack\TosBthSupport_ForMSStack.sln /rebuild "release|Win32"@devenv.exe %cd%\BtMon_SystemDriver_0725\BtMon\TosBthSupport_ForMSStack\TosBthSupport_ForMSStack.sln /rebuild "Release|x64"@echo 2.Building RMService......@devenv.exe %cd%\RMService\RMService.sln /rebuild "Win8.1 Release|Win32"@devenv.exe %cd%\RMService\RMService.sln /rebuild "Win8.1 Release|x64"@echo 3.Building TabSysSvc......@devenv.exe "%cd%\Tablet_System_Service\trunk\(Released)TOSTABSYSSVCINST_20130228a\TOSTABSYSSVCINST.sln" /rebuild "release|Win32"@rem devenv.exe "%cd%\Tablet_System_Service\trunk\(Released)TOSTABSYSSVCINST_20130228a\TOSTABSYSSVCINST.sln" /rebuild "release|x64"@devenv.exe %cd%\Tablet_System_Service\trunk\TOSTABSYSSVC_Config_version\TOSTABSYSSVC.sln /rebuild "release|Win32"@devenv.exe %cd%\Tablet_System_Service\trunk\TOSTABSYSSVC_Config_version\TOSTABSYSSVC.sln /rebuild "release|x64"@echo 4.Building Tosrfec......@devenv.exe %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\tosrfec.sln /rebuild "Win8 Release|Win32" @devenv.exe %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\tosrfec.sln /rebuild "Win8 Release|x64" @echo 5.Building TosSysHID......@devenv.exe %cd%\TosSysHID\C++\TosHidSysRadioSwitch.sln /rebuild "Win8 beta Release|Win32" @devenv.exe %cd%\TosSysHID\C++\TosHidSysRadioSwitch.sln /rebuild "Win8 beta Release|x64" @echo 6.Building TVALZ......@devenv.exe "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win7\TVALZ_Win8\TVALZ_Win7.sln" /rebuild "Win8 Release|Win32"@devenv.exe "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win7\TVALZ_Win8\TVALZ_Win7.sln" /rebuild "Win8 Release|x64"@devenv.exe "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\TVALZ_Win8.sln" /rebuild "Win8 Release|Win32"@devenv.exe "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\TVALZ_Win8.sln" /rebuild "Win8 Release|x64"@echo 7.Building TosQnt......@rem This project need VS2010@"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" %cd%\quick-note-taking_trunk\TosQntExe\TosQntExe.sln /rebuild "release|Win32"@echo 8.Making DIR for Package......@md %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1\x64@md %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10\x64@md %cd%\SystemDriver-WaitForSign\BtMon\DriverXP\x64@md %cd%\SystemDriver-WaitForSign\RMService\x86@md %cd%\SystemDriver-WaitForSign\RMService\x64@md %cd%\SystemDriver-WaitForSign\TabSysSvc\32bit@md %cd%\SystemDriver-WaitForSign\TosQnt@echo 9.Copying Files to Package DIR......@xcopy %cd%\BtMon_SystemDriver_0725\BtMon\bin\*.* %cd%\SystemDriver-WaitForSign\BtMon@xcopy %cd%\quick-note-taking_trunk\TosQntExe\Release\TosQntExe.exe %cd%\SystemDriver-WaitForSign\TosQnt@xcopy %cd%\RMService\Win8.1Release\RMService.exe %cd%\SystemDriver-WaitForSign\RMService\x86@xcopy %cd%\RMService\x64\Win8.1Release\RMService.exe %cd%\SystemDriver-WaitForSign\RMService\x64@xcopy %cd%\Tablet_System_Service\trunk\TOSTABSYSSVC_Config_version\Release\TOSTABSYSSVC.exe %cd%\SystemDriver-WaitForSign\TabSysSvc\32bit@xcopy %cd%\Tablet_System_Service\trunk\TOSTABSYSSVC_Config_version\x64\Release\TOSTABSYSSVC.exe %cd%\SystemDriver-WaitForSign\TabSysSvc\@xcopy "%cd%\Tablet_System_Service\trunk\(Released)TOSTABSYSSVCINST_20130228a\Release\TOSTABSYSSVCINST.exe" %cd%\SystemDriver-WaitForSign\TabSysSvc\@xcopy %cd%\TosSysHID\C++\Win8betaRelease\Thotkey.sys %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1@xcopy %cd%\TosSysHID\C++\Win8betaRelease\Thotkey.sys %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10@rem @xcopy %cd%\TosSysHID\C++\Win8betaRelease\Thotkey.inf %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1@rem @xcopy %cd%\TosSysHID\C++\Win8betaRelease\Thotkey.inf %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10@xcopy %cd%\TosSysHID\C++\x64\Win8betaRelease\Thotkey.sys %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1\x64@xcopy %cd%\TosSysHID\C++\x64\Win8betaRelease\Thotkey.sys %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10\x64@rem @xcopy %cd%\TosSysHID\C++\x64\Win8betaRelease\Thotkey.inf %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1\x64@rem @xcopy %cd%\TosSysHID\C++\x64\Win8betaRelease\Thotkey.inf %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10\x64@xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x32\Tosrfec.sys %cd%\SystemDriver-WaitForSign\BtMon\DriverXP@xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x32\Tosrfec.sys %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1@xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x32\Tosrfec.sys %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10@rem @xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x32\Tosrfec.inf %cd%\SystemDriver-WaitForSign\BtMon\DriverXP@rem @xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x32\Tosrfec.inf %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1@rem @xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x32\Tosrfec.inf %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10@xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x64\Tosrfec.sys %cd%\SystemDriver-WaitForSign\BtMon\DriverXP\x64@xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x64\Tosrfec.sys %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1\x64@xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x64\Tosrfec.sys %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10\x64@rem @xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x64\Tosrfec.inf %cd%\SystemDriver-WaitForSign\BtMon\DriverXP\x64@rem @xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x64\Tosrfec.inf %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1\x64@rem @xcopy %cd%\tosrfec_1030_Newest\tosrfec_1030_Newest\tosrfec\bin\x64\Tosrfec.inf %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10\x64@xcopy "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\Win8Release\*.sys" %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1@xcopy "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\Win8Release\*.sys" %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10@rem @xcopy "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\Win8Release\*.sys" %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1@rem @xcopy "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\Win8Release\*.sys" %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10@xcopy "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\x64\Win8Release\*.sys" %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1\x64@xcopy "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\x64\Win8Release\*.sys" %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10\x64@rem @xcopy "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\x64\Win8Release\*.sys" %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win8.1\x64@rem @xcopy "%cd%\TVALZ_Source_New_0725\TVALZ_Source New\Win10_Win8.1\TVALZ_Win8\x64\Win8Release\*.sys" %cd%\SystemDriver-WaitForSign\BtMon\Driver_Win10\x64 @echo ********************* Done! Please check whether each file was built and copied, thanks! *****************************
0 0
- 使用bat脚本编译VS工程
- bat命令编译vc和vs工程
- bat脚本编译java工程并打jar包
- VS中的项目使用bat脚本进行构建
- 使用incredibuild分布式编译VS工程
- 【PE】通过批处理脚本命令行编译VS工程
- 使用脚本(命令行)编译KEIL工程
- Widnows bat 编译VS项目
- VS编译c工程
- bat脚本编译单片机程序
- bat脚本使用记录
- VS工程配置输出debug版dll及copy到指定目录,执行bat脚本的方法
- VS工程配置输出debug版dll及copy到指定目录,执行bat脚本的方法
- VS脚本自动备份工程
- [转]用makefile脚本方式调用vs 2010 的nmake来编译工程的实例
- Unity3D中脚本的执行顺序和编译顺序(vs工程引用关系)
- 用makefile脚本方式调用vs 2010 的nmake来编译工程的实例
- (转)Unity3D中脚本的执行顺序和编译顺序(vs工程引用关系)
- MyBatis 入门(四)--存储过程
- wget 爬虫工具 递归下载网址
- HTML5之viewport使用
- Android Studio 入门
- spring+mybatis+druid无法读取jdbc.properties属性导致datasource加载失败
- 使用bat脚本编译VS工程
- MySQL实现类似Oracle的序列
- android Git使用gitignore建立项目过滤规则
- mysql中文无法输入或读取时乱码
- javaweb性能优化的系统思考
- 豆腐衣和冶金新工艺
- DruidParser - 源代码篇(1)
- VC/windowsx.h 和windows.h的区别
- 散列表学习总结