Solved

How do I download files from server using vbscript

Posted on 2004-04-29
9
21,061 Views
Last Modified: 2012-08-14
How do i simply download a file from a web server using vbscript with
no 3rd or additional tools ?

many thx
0
Comment
Question by:MKrauss
  • 4
  • 2
9 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 10948782
0
 
LVL 10

Expert Comment

by:Kavar
ID: 10949574
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
0
 
LVL 10

Expert Comment

by:Kavar
ID: 10949585
ack!!!! its Navigate2
not navigateto


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

to
ie.navigate2("<url here>")
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:MKrauss
ID: 10951443
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")

0
 
LVL 10

Expert Comment

by:Kavar
ID: 10952089
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")
0
 
LVL 1

Author Comment

by:MKrauss
ID: 10957176
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 ?
0
 
LVL 10

Accepted Solution

by:
Kavar earned 125 total points
ID: 10958692
dim ie
set ie.createobject("internetexplorer.application")
ie.visible=false
ie.navigateto("<url here>")
do while ie.busy=true
wscript.sleep 60
loop
ie.document.execwb("saveas",2,<destinationpathhere>)
ie.quit
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Image decoding from Camera 3 95
I need an assist with a programming logic math question. 5 73
Advice in Xamarin 21 96
Help Required 2 39
This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question