Access a folder

with AutoHotkey

by Denis Lamarre
last updated April 4, 2016
difficulty.png Easy

by Denis Lamarre


Do you have to repetitively use Windows Explorer to open folders. It might be a folder for this year's Excel spreadsheets, a folder that contains downloads or any kind of working folder.

Desktop shortcuts can be used to access popular folders, but doing so means that the user has to minimize all of their open windows, locate and click the shortcut icon, then eventually reopen all of their active windows again. If this is your experience, or your employee's time-waster, the Enterpad/AHK combo can be a time-saver.

With this simple AutoHotkey script, a folder can now appear on top of every other window without having to close other windows to find the Desktop shortcut or conducting a search for the actual folder.


Note: You can trigger the following script with your standard keyboard if you don't have an Enterpad. If so, just replace the line 1 on step 2 with your hotkey definition. The Enterpad hotkeys are useful for efficiency driven professionals who want to avoid the trouble of dealing with too many Windows hotkeys [learn more].


stencil-v4-folder.gifPrepare your overlay.
Choose a free key on the Enterpad for which you want to open a frequently-used folder. Name it something relevant, like the folder name.


Code installation.
Copy/paste the following script in your AutoHotkey script template (Enterpad.ahk) at the chosen key location. Replace our sample path (C:\Users\John Doe\Documents\ThisYear) with your path. To do so, you can open Windows Explorer to the folder you would like to access, and then copy/paste the entire path from the address bar at the top of your Windows Explorer window.

run Explorer "C:\Users\John Doe\Documents\ThisYear"

More Info

Special characters

Spaces in the path name won't cause a problem. However, should your path contain AutoHotkey special meaning characters ( ` ), (%), ( , ), or ( ; ) you will need to escape them with a backtick ( ` ). For example; if (%) appears in the path name you will have to add a backtick before it, like this (`%).

You may want to use the following script (and maybe save it as a key on your Enterpad) to automatically put the backticks before each special meaning character of the clipboard content, and paste the result at whatever point your cursor is at:

AhkFriendlyPath := RegExReplace(Clipboard, "(``|`%|`,|`;)", "``$1")
SendInput {raw}%AhkFriendlyPath%


The “Access a folder” script runs File Explorer with its default options. You can set useful options after “Explorer”. The following example starts File Explorer with the ThisYear folder selected (instead of opened):

run Explorer /select`,"c:\users\John Doe\Documents\ThisYear"

You can find more about Windows Explorer options at: (

Environment variables

Some AutoHotkey environment variables can be useful for the path name. The following example opens the current user's "My Documents\ThisYear" folder:

run Explorer "%A_MyDocuments%\ThisYear"

You can find all the AutoHotkey environment variables at: