调用CSC编译器的一个批处理文件

发表于:2007-05-25来源:作者:点击数: 标签:CSC批处理编译器文件一个
自己写的第二个实用批处理文件^^ @echo off set input=%2 set outpu=%1 set wdir=%cd% set output=%outpu%.exe cls if == (set output=out.exe) if =={} (set input=%outpu%.cs) if == goto inse if not exist %input% goto ine if exist %output% del %outp

自己写的第二个实用批处理文件^^

@echo off
set input=%2
set outpu=%1
set wdir=%cd%
set output=%outpu%.exe

cls

if ==       (set output=out.exe)
if =={}           (set input=%outpu%.cs)
if ==   goto inse                                   
if not exist %input%  goto ine
if exist %output% del %output%

pushd %windir%\Microsoft.NET\Framework\v1.1.4322\                 
csc/out:%wdir%\%output% %wdir%\%input%>%wdir%\err.txt
popd                                                             
type err.txt
goto end

:inse
echo +-----------------------+-----------------------------+
echo 请输入的要求输出的文件名,注意,不要带exe后缀,退出!
echo +-----------------------+-----------------------------+
goto end

:ine
echo +-----------------------+-----------------------------+
echo +在%wdir%中不存在%input%,无法继续,退出!+ 
echo +-----------------------+-----------------------------+

goto end

:end

原文转自:http://www.ltesting.net

评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)