Solved

How do I download files from server using vbscript

Posted on 2004-04-29
9
21,022 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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

777 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