给你一个安装并启动服务的批处理文件:
echo off
if exist "%SystemRoot%\Microsoft.NET\Framework\v2.0.50727" goto netOld
:DispError
echo 您的机器上没有安装 .net FrameWork 2.0
pause
goto LastEnd
:netOld
cd %SystemRoot%\Microsoft.NET\Framework\v2.0.50727
echo 您的机器上安装了相应的.net FrameWork,可以安装本服务,按任意键继续…………
echo off
pause
%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\installutil c:\WSDemoByTime.exe
net start "WSDemoSendMuitiMails"
:LastEnd
rem exit