1.以下代码保存为bat文件(根据VS安装目录不同需要自定义)
1 @if /I "%2" == "c" goto IsCorCPP
2 @if /I "%2" == "cpp" goto IsCorCPP
3 @goto error_par
4
5 :IsCorCPP
6 @if "%1"=="" goto error_no_par
7 @SET VSINSTALLDIR=D:\Program Files\Microsoft Visual Studio 8
8 @SET VCINSTALLDIR=D:\Program Files\Microsoft Visual Studio 8\VC
9 @SET FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework
10 @SET FrameworkVersion=v2.0.50727
11 @SET FrameworkSDKDir=D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0
12 @set DevEnvDir=D:\Program Files\Microsoft Visual Studio 8\Common7\IDE
13 @set PATH=D:\Program Files\Microsoft Visual Studio 8\Common7\IDE;D:\Program Files\Microsoft Visual Studio 8\VC\BIN;D:\Program Files\Microsoft Visual Studio 8\Common7\Tools;D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin;D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin;D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;D:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;%PATH%
14 @set INCLUDE=D:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE;D:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include;D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\include;%INCLUDE%
15 @set LIB=D:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB;D:\Program Files\Microsoft Visual Studio 8\VC\LIB;D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib;D:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;%LIB%
16 @set LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;D:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB
17 @cl %1
18 @if "%3"=="" goto end
19 @echo.
20 @echo 以下为程序 %3 运行结果:
21 @%3
22 @goto end
23
24 :error_no_par
25 @echo 请输入参数。
26 @goto end
27
28 :error_par
29 @echo 要处理的文件非C/C++文件。
30 @goto end
31 :end
2.EditPlus添加工具:
命令行为该bat文件,参数设置为:$(FileName) $(FileExt) $(FileNameNoExt).exe,初始目录设置为:$(FileDir)
posted on 2010-05-20 08:20
鸡蛋捞面 阅读(559)
评论(0) 编辑 收藏 引用