Solved

How do I download files from server using vbscript

Posted on 2004-04-29
9
20,986 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
strCount chalenge 3 70
Windows Service to Receive TCP Packets 4 122
Recommendation vb6 to vb.net or others 14 111
Basic Java Case or If-Else statement... 3 43
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.
This article will show, step by step, how to integrate R code into a R Sweave document
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 …

910 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

20 Experts available now in Live!

Get 1:1 Help Now