I finally got the conclusion to this subject and
here is the sample code.
Please note that your PC needs MDAC before you run this.
You will get it from
<SCRIPT LANGUAGE = "VBScript>
' ********************************************************
Const adTypeBinary = 1
Const adSaveCreateOverwrite = 2
Const adModeReadWrite = 3
set myXML = WScript.CreateObject("Microsoft.XMLHTTP"
sDest = "C:\MYDOCU~1\tetscopy.gif"
sSource = " ' or If you like to copy a text file
' sSource =" ' and sDest = "C:\MYDOCU~1\testcopy.js"
myXML.open "GET", Trim(" " & sSource & " "
, False
myXML.send
If (myXML.status = 200) Then
Set stream = WScript.CreateObject("adodb.stream"
stream.type = adTypeBinary
stream.mode = adModeReadWrite
stream.open
stream.write myXML.responseBody
stream.savetofile sDest, adSaveCreateOverwrite
stream.close
Set stream = Nothing
Else
' You can write any for waiting or cancelling to DL.
End If
Set myXML = Nothing
' ***************************************************
</SCRIPT>
Enjoy this for collection any files you like from web.
here is the sample code.
Please note that your PC needs MDAC before you run this.
You will get it from
<SCRIPT LANGUAGE = "VBScript>
' ********************************************************
Const adTypeBinary = 1
Const adSaveCreateOverwrite = 2
Const adModeReadWrite = 3
set myXML = WScript.CreateObject("Microsoft.XMLHTTP"
sDest = "C:\MYDOCU~1\tetscopy.gif"
sSource = " ' or If you like to copy a text file
' sSource =" ' and sDest = "C:\MYDOCU~1\testcopy.js"
myXML.open "GET", Trim(" " & sSource & " "
myXML.send
If (myXML.status = 200) Then
Set stream = WScript.CreateObject("adodb.stream"
stream.type = adTypeBinary
stream.mode = adModeReadWrite
stream.open
stream.write myXML.responseBody
stream.savetofile sDest, adSaveCreateOverwrite
stream.close
Set stream = Nothing
Else
' You can write any for waiting or cancelling to DL.
End If
Set myXML = Nothing
' ***************************************************
</SCRIPT>
Enjoy this for collection any files you like from web.