joriszwart.nl

I code dreams™

TIL executing commands in file explorer

File Explorer Microsoft Windows Productivity TIL

Introduction

Today I learned that executing commands in the Windows file explorer address bar works!

I discovered this by accident when my focus was in the wrong window. I used ⊞ win + E (file explorer) when I really meant ⊞ win + R (run command). A happy little accident.

How does it work?

  1. Start explorer.exe
  2. Go to the address bar (protip: Alt + D or Ctrl + L)
  3. Enter cmd

This starts a command window with the current directory as working directory. Ain't that nice?

Illustrated guide

Step 1 - open file explorer

Step 2 - enter a command

This happens to work with all kind of commands. Try dotnet run, php -S localhost: 8080, npm start or python3 -m http.server depending on your favorite platform.

The other way around

If you are in a command shell, enter:

start .

and it will open explorer.exe within the current directory.