Code: Select all
UrlDownloadToFile, https://autohotkey.com/download/1.1/version.txt, C:\AutoHotkey Latest Version.txt
I have IE installed and I've tried disabling my antivirus. I have no clue why it's not working.
Can you help please?
Code: Select all
UrlDownloadToFile, https://autohotkey.com/download/1.1/version.txt, C:\AutoHotkey Latest Version.txt
maybe also try with wget.exe...but the root directory is often protected from non-admin users... and scripts (you can try copying a text file there, a warning box might appear).
Either choose another directory ('Documents' or something you are allowed to write to) or try to run the script as 'admin'...
Code: Select all
f1=%a_scriptdir%\version.txt
UrlDownloadToFile, https://autohotkey.com/download/1.1/version.txt,%f1%
return
Code: Select all
f1:="https://autohotkey.com/download/1.1/version.txt"
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET",F1, true)
whr.Send()
; Using 'true' above and the call below allows the script to remain responsive.
whr.WaitForResponse()
version := whr.ResponseText
MsgBox % version
return
Code: Select all
If ( not A_IsAdmin and not TaskExists ) {
CLine := ( A_IsCompiled ? A_ScriptFullpath : """" A_AhkPath """ """ A_ScriptFullpath """" )
Run *RunAs %CLine%, %A_ScriptDir%, UseErrorLevel
OutputDebug % "AHK| RunAsAdmin ErrorLevel is: " ErrorLevel ", A_LastError is: " A_LastError
if (ErrorLevel != "ERROR")
ExitApp
}
UrlDownloadToFile, https://autohotkey.com/download/1.1/version.txt, C:\AutoHotkey Latest Version.txt
return
Code: Select all
UrlDownloadToFile, https://autohotkey.com/download/1.1/version.txt, C:\temp\AutoHotkey Latest Version.txt
Users browsing this forum: No registered users and 292 guests