本帖最后由 happy886rr 于 2017-5-17 22:12 编辑
下载地址 https://page37.ctfile.com/fs/14274637-203252278
经过精心精简,终于将2GB的VS2010精简到22M。只保留了VC++编译器的功能,效果等同于原版VS编译器,同时附上了批处理,可以直接拖拽c或cpp后缀的文件直接编译。速度极快,cpu占用极小。全部外链,下载随时失效,错过了就再也找不到。同时该批处理版VC++几乎可以在所有winPE里直接编译C代码,无需任何多余组件,兼容各种windows系统,自带各种dll。
补充,理论上可以编译MFC,ATL,但没写相应的自动化处理脚本,请自行DIY吧。
核心脚本:- @ECHO OFF
- ::************************************用户设置***********************************
- REM 用户指令
- set "USER_COMMAND=/MD /link"
-
- REM 优化参数
- set "OPTIMIZATION_COMMAND=/Ox"
-
- ::************************************高级设置***********************************
- REM 环境变量
- set "VSDIR=%~dp0VCDIR"
- set "PATH=%VSDIR%\bin;%PATH%;"
- set "INCLUDE=%VSDIR%\include;%VSDIR%\WinSDK\include"
- set "LIB=%VSDIR%\lib;%VSDIR%\WinSDK\lib"
-
- ::*************运行阶段*************
- REM 判断后缀
- if /i "%~f1"=="" (goto :CMD_CONSOLE)
- if /i "%~x1"==".c" (goto :VS2010_COMPILER)
- if /i "%~x1"==".cpp" (goto :VS2010_COMPILER)
- set/p=Error: 非c、cpp后缀文件
- exit /b
-
- REM 执行编译
- VS2010_COMPILER()
- {
- :VS2010_COMPILER
- echo [正在编译]...
- echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- PUSHD "%~DP1"
- set RET=1
- CL "%~F1" %OPTIMIZATION_COMMAND% %USER_COMMAND%"
- set RET=%errorlevel%
- 2>NUL del /f /q *.obj
-
- if %RET% equ 0 (
- echo;
- echo [正在运行] ...
- echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- "%~n1"
- echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- echo [运行结束]
- ) else (
- echo [编译错误] ...
- )
- pause>NUL
- exit /b
- }
-
- REM 执行CMD
- CMD_CONSOLE()
- {
- :CMD_CONSOLE
-
- echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- echo [CMD console]
- set/p COMMEND_LINE=^>
- %COMMEND_LINE%
- echo;
- goto :CMD_CONSOLE
- }
复制代码
|