注册了,就可以使用命令行编译了
不过不注册也一样……给你看看我写的嵌入VC6编译器的批处理代码:
@echo off
::VC6编译器
Set AppDir=%1
Set FileDir=%2
Set FileNameNotExt=%3
Set FileExt=%4
Set OutputFile=%FileDir:~1,-1%\%FileNameNotExt:~1,-1%.exe
Set FilePath=%FileDir:~1,-1%\%FileNameNotExt:~1,-1%.%FileExt:~1,-1%
Set VCInstallDir=%AppDir:~1,-1%\..\VC98
Set Path="%VCInstallDir%\BIN"
Set Include=%VCInstallDir%\INCLUDE
Set Lib=%VCInstallDir%\LIB
echo 正在编译:%FilePath% ...
cl /nologo /W3 /EHsc /O2 "%FilePath%"
:exit
if %ErrorLevel% == 0 (
echo 编译成功!
) else (
echo 编译失败,请检查错误!
)
del /q "%FileDir:~1,-1%\%FileNameNotExt:~1,-1%.obj" 2>nul