Ветеран
Сообщения: 27449
Благодарности: 8087
|
Профиль
|
Отправить PM
| Цитировать
Например, так:
читать дальше »
Код:
<?xml version='1.0' encoding='windows-1251' standalone='yes'?>
<job>
<script language='VBScript'>
<![CDATA[
Option Explicit
Const adTypeBinary = 1
Const adModeReadWrite = 3
Const adSaveCreateOverWrite = 2
Dim strUrl
Dim strDestPath
Dim objFSO
Dim objXMLHTTPRequest
strUrl = "http://tau.rghost.ru/57502402/image.png"
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
strDestPath = objFSO.BuildPath(WScript.CreateObject("Shell.Application").NameSpace("shell:AppData").self.Path, "adobe")
If objFSO.FolderExists(strDestPath) Then
Set objXMLHTTPRequest = WScript.CreateObject("Msxml2.XMLHTTP")
objXMLHTTPRequest.Open "GET", strUrl,False
objXMLHTTPRequest.send
If objXMLHTTPRequest.status = 200 Then
With WScript.CreateObject("ADODB.Stream")
.Mode = adModeReadWrite
.Type = adTypeBinary
.Open
.Write objXMLHTTPRequest.responseBody
.SaveToFile objFSO.BuildPath(strDestPath, objFSO.GetFileName(decodeURI(strUrl))), adSaveCreateOverWrite
End With
Else
WScript.Echo "Status: " & CStr(objXMLHTTPRequest.status)
End If
Set objXMLHTTPRequest = Nothing
Else
WScript.Echo "Destination path [" & strDestPath & "] not found."
WScript.Quit 1
End If
Set objFSO = Nothing
WScript.Quit 0
]]>
</script>
<script language='JScript'>
<![CDATA[
function decodeURI(sUrl) {
return decodeURI(sUrl);
}
]]>
</script>
</job>
|
Отправлено: 13:54, 17-08-2014
| #8
|