How to get to downloads folder?

Get help with using AutoHotkey and its commands and hotkeys
omar
Posts: 394
Joined: 22 Oct 2015, 17:56

How to get to downloads folder?

20 Jul 2017, 09:52

Is there a Windows environment shortcut to get to the downloads folder?
Is there a list of environment shortcuts somewhere?

Thanks
qwerty12
Posts: 468
Joined: 04 Mar 2016, 04:33
GitHub: qwerty12

Re: How to get to downloads folder?

20 Jul 2017, 10:02

EDIT: Even easier: Run shell:::{374DE290-123F-4565-9164-39C4925E467B}. Use the code below if you want to find the actual path of the "Downloads" folder instead of quickly opening it.

Code: Select all

#NoEnv
if (!DllCall("shell32\SHGetKnownFolderPath", "Ptr", GuidFromStr("{374DE290-123F-4565-9164-39C4925E467B}", FOLDERID_Downloads), "UInt", KF_FLAG_NO_ALIAS := 0x00001000, "Ptr", 0, "Ptr*", szPath))
{
	WStrOut(szPath)
	Run %szPath%
}

; From Coco-Belgica's Guid.ahk
GuidFromStr(sGuid, ByRef VarOrAddress) {
	if IsByRef(VarOrAddress) && (VarSetCapacity(VarOrAddress) < 16)
		VarSetCapacity(VarOrAddress, 16) ; adjust capacity
	pGuid := IsByRef(VarOrAddress) ? &VarOrAddress : VarOrAddress
	if ( DllCall("ole32\CLSIDFromString", "WStr", sGuid, "Ptr", pGuid) < 0 )
		throw Exception("Invalid GUID", -1, sGuid)
	return pGuid ; return address of GUID struct
}

; From Lexikos' VA.ahk
WStrOut(ByRef str) {
	str := StrGet(ptr := str, "UTF-16")
	DllCall("ole32\CoTaskMemFree", "ptr", ptr)
	return str
}
This won't work on XP. If I remember correctly, XP didn't have a system-sanctioned folder for downloads; that came with Vista.
omar
Posts: 394
Joined: 22 Oct 2015, 17:56

Re: How to get to downloads folder?

20 Jul 2017, 10:09

A W E S O M E !
thks
User avatar
Cerberus
Posts: 131
Joined: 12 Jan 2016, 15:46

Re: How to get to downloads folder?

01 May 2019, 16:02

And also thanks from me!

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 220 guests