wget是linux下的从网络上自动下载文件的自由工具,它支持http,https和ftp协议,可以使用http代理,目前已经移植到windows下。它提供“下载文件除非比本地文件新”时更新下载,下载续传,下载文件目录保存等功能,更多功能见附件。
下面根据hxj的dos杀毒关盘为例,修改自动升级的批处理:
1:把下载附件中wget.exe拷贝到系统目录,一般为c:\windows,upd.bat修改如下:
echo off
wget -nh -n -c http://dos.cf91.com/update/update.exe
if not exist update.exe echo " can not update now " && pause && goto end
update.exe -s
exit
:end
说明:-nh表示不创建目录,下载到当前目录下;-n表示相同文件不下载;-c表示下载续传。
还有做得更漂亮点,隐藏dos窗口,可用hidecmd命令。