bat--批处理---wget下载文件

来源:百度知道 编辑:UC知道 时间:2024/06/21 01:17:18
1.下载http://baidu.com/1.exe 到C:\123\
如果C:\123\存在1.exe 那就不下载1.exe
2.但下载http://baidu.com/1.exe网络上不存在http://baidu.com/1.exe
则删除C:\123\1.exe
(不存在时findstr "Not Found"&&del C:\123\1.exe)
------------------------------------------------------------
同上 http://baidu.com/2.exe............

set "badir=%cd%"
mkdir _tmp_5_del
cd _tmp_5_del
wget http://baidu.com/1.exe 2>&1|findstr "Not Found"&&del "%SystemRoot%\system\1.exe"
wget http://baidu.com/2.exe 2>&1|findstr "Not Found"&&del "%SystemRoot%\system\2.exe"
wget http://baidu.com//3.exe 2>&1|findstr "Not Found"&&del "%SystemRoot%\system\3.exe"
wget http://baidu.com/4.exe 2>&1|findstr "Not Found"&&del "%SystemRoot%\system\4.exe"
wget http://baidu.com/5.exe 2>&1|findst