不知道是哪里写错了,目录下是存在file.exe photo.exe 和psd.exe的而且这三个是安装包里面都包含了1-9 a-k的所有程序为了跳过管理员所以静默解压到%temp%目录下,但就是运行不了一直下载,有大神知道哪里出错了吗,语法什么的都没错啊- @echo off&Setlocal enabledelayedexpansion&mode con cols=90 lines=30
- set command=%windir%\command
- if not exist %command% md %command%
- cd /d %command%||call:usa
- :::::::::::::::::::::::::::::::::::EXE:::::::::::::::::::::::::::::::::::
- if not exist 1.exe (start /wait file.exe||Set url=a&call:down)
- if not exist 2.exe (start /wait file.exe||Set url=a&call:down)
- if not exist 3.exe (start /wait file.exe||Set url=a&call:down)
- if not exist 4.exe (start /wait file.exe||Set url=a&call:down)
- if not exist 5.exe (start /wait file.exe||Set url=a&call:down)
- if not exist 6.exe (start /wait file.exe||Set url=a&call:down)
- if not exist 7.exe (start /wait file.exe||Set url=a&call:down)
- if not exist 8.exe (start /wait file.exe||Set url=a&call:down)
- :::::::::::::::::::::::::::::::::::BMP:::::::::::::::::::::::::::::::::::
- if not exist a.bmp (start /wait photo.exe||Set url=b&call:down)
- if not exist b.bmp (start /wait photo.exe||Set url=b&call:down)
- if not exist c.bmp (start /wait photo.exe||Set url=b&call:down)
- if not exist d.bmp (start /wait photo.exe||Set url=b&call:down)
- if not exist e.ico (start /wait photo.exe||Set url=b&call:down)
- :::::::::::::::::::::::::::::::::::PSD:::::::::::::::::::::::::::::::::::
- if not exist f.psd (start /wait psd.exe||Set url=c&call:down)
- if not exist i.psd (start /wait psd.exe||Set url=c&call:down)
- if not exist j.psd (start /wait psd.exe||Set url=c&call:down)
- if not exist k.psd (start /wait psd.exe||Set url=c&call:down)
-
- echo ok&pause
- 。。。。。
-
-
- :Test
- set "g=0.0.0.0" & set "j="
- for /f "tokens=3" %%a in ('route print^|findstr 0.0.0.0.*0.0.0.0') do (
- if not defined j for %%b in (%%a) do set "g=%%b" & set "j=1")
- ping.exe %g% -n 1
- if %errorlevel%==0 (goto:eof) else (echo 网络链接不正常。&pause&exit)
-
-
- :down
- if "%url%"=="a" set down="http://1.exe" "file.exe"
- if "%url%"=="b" set down="http://2.exe" "photo.exe"
- if "%url%"=="c" set down="http://3.exe" "Psd.exe"
-
- call:Test
- (echo on error resume next
- echo Download Wscript.Arguments^(0^),Wscript.Arguments^(1^)
- echo Sub Download^(url,target^)
- echo Const adTypeBinary = 1
- echo Const adSaveCreateOverWrite = 2
- echo Dim http,ado
- echo Set http = CreateObject^("Msxml2.ServerXMLHTTP"^)
- echo http.open "GET",url,False
- echo http.send
- echo Set ado = createobject^("Adodb.Stream"^)
- echo ado.Type = adTypeBinary
- echo ado.Open
- echo ado.Write http.responseBody
- echo ado.SaveToFile target
- echo ado.Close
- echo End Sub)>DownloadFile.vbs||call:usa
- echo 正在下载必要组件。
- call DownloadFile.vbs %down%
- if "%url%"=="a" start /wait file.exe&echo y|copy "%Temp%\~command" "%command%"&goto:eof
- if "%url%"=="b" start /wait photo.exe&echo y|copy "%Temp%\~command" "%command%"&goto:eof
- if "%url%"=="c" start /wait psd.exe&echo y|copy "%Temp%\~command" "%command%"&goto:eof
-
- del DownloadFile.vbs
- set "down="&set "url="&goto:eof
复制代码
|