Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
Internet File Download Script - Getting caught by Virus Scanner
Logged in as: Guest
arrSession:exec spGetSession 2,2,62208
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> Internet File Download Script - Getting caught by Virus Scanner
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
Internet File Download Script - Getting caught by Virus... -
7/7/2008 11:57:17 PM
GreatBarrier86
Posts: 71
Score: 0
Joined: 3/10/2008
Status:
offline
Hi,
I have the following script, but when i try to run it, it gets stopped by McAfee. Does anyone know what i could do differently so as to prevent this?
Option Explicit Dim sFileToDownload sFileToDownload = InternetFileDownload("[link=http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsXP-KB942288-v3-x86.exe]http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsXP-KB942288-v3-x86.exe[/link]") Function InternetFileDownload(InternetURL) Dim InternetBuffer Dim ADODB Dim oFSO Set oFSO = WScript.CreateObject("Scripting.FileSystemObject") Set ADODB = CreateObject("ADODB.Stream") Set InternetBuffer = CreateObject("Msxml2.XmlHttp") InternetBuffer.open "GET", InternetURL, False On Error Resume Next InternetBuffer.send "" On Error Goto 0 If InternetBuffer.Status = 200 Then If ADODB.State <> 0 Then ADODB.Close ADODB.Type = 1 '(1=binary,2=Text) ADODB.Mode = 3 '(1=Read,2=Write,3=RW) ADODB.Open ADODB.Write InternetBuffer.ResponseBody ADODB.SaveToFile("C:\Users\Jsoby\Desktop\" & oFSO.GetFileName(InternetURL)), 2 ADODB.Close End If If InternetBuffer.Status = 200 Then InternetFileDownload = ("C:\Users\Jsoby\Desktop\" & oFSO.GetFileName(InternetURL)) End If End Function
Post #: 1
RE: Internet File Download Script - Getting caught by V... -
7/9/2008 12:58:36 AM
Rischip
Posts: 502
Score: 2
Joined: 3/26/2007
Status:
offline
It seems Mcafee doesn't like these two lines in a vbscript....
ADODB.Write InternetBuffer.ResponseBody
ADODB.SaveToFile("C:\Users\Jsoby\Desktop\" & oFSO.GetFileName(InternetURL)), 2
Take one out and the script doesn't get flagged any longer.
I would look at
BitsAdmin
from Microsoft. It can download files from IIS. It can also resume after reboots and disconnects and so forth.
Here is some code that works for what you are trying to do, but it is painfully slow....
URL="http://download.microsoft.com/download/2/6/1/261fca42-22c0-4f91-9451-0e0f2e08356d/WindowsXP-KB942288-v3-x86.exe" TEMPPATH = "C:\temp\" OUTPUTFILE = TEMPPATH & Mid(URL, InStrRev(URL, "/") + 1) Const ForReading = 1 , ForWriting = 2 , ForAppending = 8 Set fsoMain = CreateObject("Scripting.FileSystemObject") Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1") Set fsResults = fsoMain.OpenTextFile(OUTPUTFILE,ForWriting, True) Call objHTTP.Open("GET", url, FALSE) objHTTP.Send For i = 1 to lenb(objHTTP.ResponseBody) fsResults.write Chr(Ascb(midb(objHTTP.ResponseBody,i,1))) Next fsResults.Close()
Got it from here....
http://groups.msn.com/windowsscript/general.msnw?action=get_message&mview=0&ID_Message=10498&LastModified=4675495719963745623
and tested it. It works, but like I said painfully slow.
_____________________________
Rischip
Author of - The Grim Linker
(in reply to
GreatBarrier86
)
Post #: 2
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
WSH & Client Side VBScript
>> Internet File Download Script - Getting caught by Virus Scanner
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI