An AutoHotKey script that launches VS Code from File Explorer when you type Alt-Win-.
.
I use VS Code as my primary editor. I'm constantly in & out of code repos & single files, and I think the File Explorer context menu is a giant pain in the behind.
This is just better: pick one or more artifacts and hit an easy key combo. Done!
-
Download & install AutoHotKey v2 from the AHK home page.
-
Type
Win-R
and entershell:startup
in the dialog to open your startup apps folder. -
Do you have a User or System VS Code installation? Download either
dot-code-user.ahk
ordot-code-system.ahk
and copy it into your startup apps folder. -
Restart your machine.
Open a directory (say a code repository) in File Explorer. Type Alt-Win-.
without selecting any files or subdirectories, and the entire directory will open in VS Code.
Open a parent directory containing multiple code repos. Select a repo folder, type Alt-Win-.
, and only the selected repo will open in VS Code.
Now open a repo and select one or more files. When you type Alt-Win-.
, only the selected files will open in VS Code.
The key combination is articulated in this line of the script, specifically the #!.
before the trailing ::
.
To change the key combo, just replace #!.
with your own combo. See the AutoHotKey docs for more help.