|
[注意]深山红叶启动光盘(WinPE&PE Builder)讨论专帖(违令者必删)
[这个贴子最后由Climbing在 2004/11/26 05:07pm 第 1 次编辑]
呵呵,我也写了一个,请大家自己选择:
@echo off
:: SysClean.cmd 下载并启用趋势杀毒
:: 创建者:深山红叶
:: 修改者:Climbing (xclimbing@msn.com)
:: 修改日期:2004.11.26
:: 增加wget的代理服务器设置
title SysClean 趋势杀毒...
echo.
echo 首先请确认您已连上Internet。
echo.
echo 按任意键开始。
pause >nul
if not exist %temp%\wget.exe copy /y %1\pexp\system32\wget.exe %temp%\ > nul
if not exist %temp%\wgetrc if exist %1\pexp\system32\wgetrc copy /y %1\pexp\system32\wgetrc %temp%\ > nul
set wget=%temp%\wget.exe
set WGETRC=%temp%\wgetrc
if not exist %wgetrc% goto _IfProxy
type %wgetrc% | find /i "http_proxy" > nul
if errorlevel 1 goto _IfProxy
echo.
echo.
echo 你曾经配置过代理服务器,配置如下(%wgetrc%):
type %wgetrc%
set input=
set /p input=是否需要重新配置[Y,N]?
echo "%input%" | find /i "y" > nul
if errorlevel 1 goto _start
:_IfProxy
> %wgetrc% echo #used by wGetGUI and wGet
>> %wgetrc% echo #edit only if you know what you are doing!
echo.
echo.
set input=
set /p input=请问您是否需要使用代理服务器[Y,N]?
echo "%input%" | find /i "n" > nul
if errorlevel 1 goto _proxy
goto _start
:_proxy
:_proxyserver
echo.
echo.
echo.
set input=
echo ================= 配置代理服务器地址及端口号 ===================
echo 输入格式为:代理服务器IP:端口号(注意冒号为半角)
echo 例如:192.168.0.1:8080
echo.
set /p input=请输入代理服务器地址及端口号:
if "%input%"=="" goto _err1
echo %input% | find ":" > nul
if errorlevel 1 goto _err1
set http_proxy=%input%
>> %wgetrc% echo http_proxy = %http_proxy%
goto _proxyuser
:_err1
echo.
echo !!!错误!!!:您的输入为空或者存在错误!
set input=
set /p input=您是否需要重新输入[Y,N]?
echo "%input%" | find /i "n" > nul
if errorlevel 1 goto _proxyserver
echo 您最终选择了不配置代理服务器!
goto _start
:: 考虑到检测用户的输入是如此麻烦,因此下面不再检测用户的输入
:_proxyuser
echo.
echo ============== 配置代理服务器用户 ==============
set input=
set /p input=请输入访问代理服务器的用户名:
if not "%input%"=="" set proxy_user=%input%
>> %wgetrc% echo proxy_user = %proxy_user%
:_proxypasswd
echo.
echo ============== 配置代理服务器用户密码 ==============
set input=
set /p input=请输入访问代理服务器的用户密码:
if not "%input%"=="" set proxy_passwd=%input%
>> %wgetrc% echo proxy_passwd = %proxy_passwd%
:_start
:S1
if exist %temp%\sysclean.com goto S2
echo.
echo 开始下载 Sysclean 可执行工具 sysclean.com ...
cd /d %temp%\
%wget% http://www.trendmicro.com/ftp/products/tsc/sysclean.com
:S2
if exist %temp%\lpt.zip goto S3
echo.
echo 开始下载病毒库文件...
cd /d %temp%\
%wget% http://www.trendmicro.com/download/pattern.asp
for /f "tokens=2 delims==>" %%a in (';findstr lpt pattern.asp';) do %wget% --output-document=lpt.zip %%~a
echo.
echo 下载完毕,开始解压缩病毒库文件...
:S3
cd /d %temp%\
start /min %1\programs\winrar\winrar.exe x -y %temp%\lpt.zip %temp%\
start sysclean.com
set input=
exit
|
|