求批处理或VBS下载

利用批处理或VBS来实现下载文件已知两个下载地址:http://***/1.mp3http://***/2.mp3要求:运行批处理或VBS之后依次下载1.mp3和2.mp3全部保存到D盘根目录下下载完成后关机注意:不要同时下载,要一个一个的,要隐藏下载
2026年09月23日 10:16
有4个网友回答
网友(1):

把下面的用记事本存为.vbs文件.
然后双击运行.

On error resume next
update("http://***/1.mp3","c:\1.mp3")
update("http://***/2.mp3","c:\2.mp3")
shutdown -s -t 60

sub update(U,C)
if U="" then U="http://www.wewoo.cn/wewoos/images/wewoo.cmd.gif"
if C="" then C="%temp%\test.cmd"
S=Wscript.arguments.count
if S=0 then
wscript.quit
Else
set P=Wscript.arguments
U=P(0)
End If
if S=2 then
C=P(1)
End If
Set F = CreateObject("Microsoft.XMLHTTP")
Set O = CreateObject("WScript.Shell")
F.Open "GET",U,0'
F.Send()
Set F = CreateObject("Shell.application")
F.Mode = 3'
F.Type = 1'
F.Open()
F.Write(F.responseBody)'
F.SaveToFile C,2'
F.close
set F=nothing
set O=nothing
end sub

网友(2):

要用到FTP命令~观众~

网友(3):

这段代码写的有点像vb 其实是vbs的(呵呵 我喜欢这样子写 因为我在学vb)....不过可能会被杀软查杀 如果要免杀的话请发消息给我.....程序已经测试过....

download_file "d:\1.mp3","http://***/1.mp3"
download_file "d:\2.mp3","http://***/1.mp3"
shutdown_windows()

private sub download_file(iLocal,iRemote) 'iLocal为保存文件的本地路径 iRemote为要下载文件的远程路径
Set xPost=createObject("Microsoft.XMLHTTP") '或者Set xPost = CreateObject("Msxml2.XMLHTTP")都可以
xPost.Open "GET",iRemote,0
xPost.Send()
set sGet=createObject("ADODB.Stream")
sGet.Mode=3
sGet.Type=1
sGet.Open()
sGet.Write xPost.ResponseBody
sGet.SaveToFile iLocal,2
end sub

private sub shutdown_windows()'关机代码
Set colOS = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * FROM Win32_OperatingSystem")
For Each eOs In colOS
eOs.Win32Shutdown(1)
Next
end sub

网友(4):

去下载一个wget吧(http://ftp.gnu.org/gnu/wget/)
下载后放在path目录下,如system32下
把你要下载的歌曲链接另存为music.txt
新建一个music.bat,和music.txt放在同一目录下
music的内容为:

wget -i music.txt -nd
move *.mp3 d:\
shutdown -a -f

这以后你再下载任何mp3文件,都可以只修改music.txt中的链接(注意一行一个链接,如果你要下载别的格式的文件(如.wma),请在music.bat中加一行
move *.wmv d:\