Solved

How do I download files from server using vbscript

Posted on 2004-04-29
9
20,946 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now