When working on my Windows laptop, I often find myself needing to launch a new command prompt. The need usually arises in the active folder in Windows Explorer, or in Total Commander (my favorite file manager on Windows).
This happens pretty often, so I decided to create a keyboard shortcut to automate the process. To do this, I used AutoHotKey – the awesome Windows automation tool.
Properties and features of the AHK script I came up with:
- Invoked with a keyboard shortcut
Ctrl
+Alt
+T
(so it’s consistent with launching the terminal in Linux). - If in Windows Explorer – start the command prompt in the current directory.
- If in Total Commander – start the command prompt in the current directory of the active pane.
- Otherwise, use a default directory (e.g., the home directory).
The code:
Leave a Reply