A
A
AntohaRomaha2017-04-28 15:06:41
Automation
AntohaRomaha, 2017-04-28 15:06:41

How to download files from the Internet via http to a computer via vbs or bat and run one of them automatically?

Firework.
I have 3 files: start.bat, file1.bin, file2.bin. They are in the 8.8.8.8/mybat folder .
I need such a vbs or bat - so that when I start it, these 3 files are downloaded to the user's computer, with the replacement of the old ones, in a certain folder - and the downloaded start.bat file starts automatically upon loading. Plz tell me
, how to implement?
Thank you.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
AntohaRomaha, 2017-04-28
@AntohaRomaha

Set FSO = CreateObject("Scripting.FileSystemObject")

If Not FSO.FolderExists("C:\icrules") Then 
FSO.CreateFolder("C:\icrules")
End If

Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")
oXMLHTTP.Open "GET", "http://myurl.ru/fest/settings.properties", 0
oXMLHTTP.Send
Set oADOStream = CreateObject("ADODB.Stream")
oADOStream.Mode = 3
oADOStream.Type = 1
oADOStream.Open
oADOStream.Write oXMLHTTP.responseBody
oADOStream.SaveToFile "c:\icrules\settings.properties", 2

A
Alexander, 2017-04-28
@NeiroNx

It is forbidden to download anything without the knowledge of the user. Such software is considered a type of malware. There are a lot of implementations, for obvious reasons I will not give them here.

K
kalapanga, 2017-04-28
@kalapanga

Something like this, for example: 3 ways to download files with PowerShell
Well, it's not clear why the proposed wget didn't please you. Those. you will lay out your batch file / script on users' computers, and religion does not allow putting wget.exe next to it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question