Link to home
Start Free TrialLog in
Avatar of MKrauss
MKrauss

asked on

How do I download files from server using vbscript

How do i simply download a file from a web server using vbscript with
no 3rd or additional tools ?

many thx
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Avatar of Kavar
Kavar

you con use the execwb command from the internetexplorer.application object

dim ie
set ie.createobject("internetexplorer.application")
ie.visible=false
ie.navigateto("<url here>")
ie.document.execwb("saveas",false,<destinationpathhere>)
ie.quit
ack!!!! its Navigate2
not navigateto


change
ie.navigateto("<url here>")

to
ie.navigate2("<url here>")
Avatar of MKrauss

ASKER

hmmm,
i'm getting an error , can not use parantheses when calling a sub within

ie.document.execwb("saveas",false,"c:\")
or
ie.document.execwb("saveas",false,"c:\file.txt")

arg.....!!!!

(thats why i should test things first)
vbscript will not allow functions with multiple parameters to be called on the left side, to get around, change to...

call ie.document.execwb("saveas",false,"c:\file.txt")
Avatar of MKrauss

ASKER

This shows me then a unsepcified error and the download dialog appears (open,save etc),
is there a way to fide it and do a auto save ?
ASKER CERTIFIED SOLUTION
Avatar of Kavar
Kavar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial