UrlDownloadToFile Alternative Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
TablePerson22
Posts: 40
Joined: 04 Mar 2021, 20:27

UrlDownloadToFile Alternative

Post by TablePerson22 » 18 Oct 2021, 15:09

UrlDownloadToFile doesn't appear to be working. I'm assuming because it uses IE?
Is there an alternative way to do this?
Thank you,

Code: Select all

folder := "test"

url := "https://www.autohotkey.com/download/ahk.zip"
filename := A_Desktop "\" folder

If !FileExist(filename)
FileCreateDir, %filename%

UrlDownloadToFile, %url%, %filename%

ExitApp

User avatar
mikeyww
Posts: 26437
Joined: 09 Sep 2014, 18:38

Re: UrlDownloadToFile Alternative  Topic is solved

Post by mikeyww » 18 Oct 2021, 15:21

The filename is a path to a file.

Code: Select all

UrlDownloadToFile, %url%, %filename%\ahk.zip
Explained: UrlDownloadToFile

TablePerson22
Posts: 40
Joined: 04 Mar 2021, 20:27

Re: UrlDownloadToFile Alternative

Post by TablePerson22 » 18 Oct 2021, 15:24

oh :oops: Thanks very much, that's working!

AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: UrlDownloadToFile Alternative

Post by AHKStudent » 18 Oct 2021, 20:55

TablePerson22 wrote:
18 Oct 2021, 15:24
oh :oops: Thanks very much, that's working!
I would like to add that it doesn't use IE. You can see the 3rd sample here to learn more

https://www.autohotkey.com/docs/commands/URLDownloadToFile.htm

garry
Posts: 3720
Joined: 22 Dec 2013, 12:50

Re: UrlDownloadToFile Alternative

Post by garry » 19 Oct 2021, 10:23

also an example , get name ( example last ahk-version )

Code: Select all

url:="https://autohotkey.com/download/1.1/version.txt"
SplitPath,url,name, dir, ext, name_no_ext, drive
Path := A_Desktop . "\" . name
urldownloadtofile,%url%,%path%
try,
 run,%path%
exitapp

Post Reply

Return to “Ask for Help (v1)”