@REM By unknown

@echo off
color 0A

%~d1
cd %~p1

set _source_=
set _dll_=

:LOOP

if "%1" == "" goto COMPILE
if /i "%~x1"==".cs" goto SOURCE
if /i "%~x1"==".dll" goto DLL
goto SFT

:SOURCE
if "%_source_%"=="" goto S2

:S1
set _source_=%_source_% %~nx1
goto SFT

:S2
set _source_=%~nx1
goto SFT

:DLL
if "%_dll_%"=="" goto D2

:D1
set _dll_=%_dll_%,%~nx1
goto SFT

:D2
set _dll_=%~nx1
goto SFT

:SFT
shift
goto LOOP

:COMPILE
set _compilerdir_=%WinDir%\MicroSoft.NET\Framework\v2.0.50727\
set _compiler_=%_compilerdir_%csc.exe /unsafe

if "%_dll_%"=="" goto C2

:C1
%_compiler_% /r:%_dll_% %_source_%
goto RESULT%errorlevel%

:C2
%_compiler_% %_source_%
goto RESULT%errorlevel%

:RESULT1
echo -------------------------------------------
echo compileing %_source_% is failed!
echo -------------------------------------------
pause
goto END


:END

usage:
directly drag a single of filename.cs on its merits; automatically renewable make-up filename.exe or filename.exe dll.only just to add " /t:library"
after,drag the filename.exe on visual studio.net 200x Command Prompt.you will see the result.

Ancient Dragon commented: this isn't shell programming forum. -7
jephthah commented: that's a harsh point reduction for a forum post mistake :( +9

what is all that crap??:icon_eek: And why is it in the c++ forum?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.