Using the command prompt can sometimes be a hassle when needing to change the directory to a certain folder before running commands. Another way of doing this instead of constantly changing the directory is to open the folder in Windows Explorer and then run the command from the address bar. This will automatically use the location as the starting point.

Run commands from Windows Explorer

Because the common way of viewing or opening folders and files from the command line is opening an existing prompt and changing the directory (“cd”) to the correct folder, let’s do this below to show a comparison. We’ve entered “cd\” to navigate all the way back to the root of the C drive.


We can also get to the same place from Windows Explorer. Open the local disk, erase the location at the top and enter “cmd” to open the command prompt from the existing directory. This is like working backward, where we begin in a particular folder and open a command prompt whereas before, we begin in a command prompt and open a folder. It’s the same result using both methods.


A lesser known method of opening files from Explorer is using this above trick to specify what program a file should open in. Instead of typing in just “cmd” to launch command prompt, choose a file that exists and enter this in the address bar. When we covered ShortcutsMan we had the executable residing on the root of the C drive so today we’ll execute this file by entering “shman.exe” which effectively opens the application. This is the same as double-clicking it but we’re using commands instead of an interface of clicking to launch the program.


Open files in a similar manner. Say we want to launch a test file in the same directory of C. With the local disk window open and active, enter the name of “test.txt.”


It’ll open just like if you were to double-click it.


To specify what program to use, instead of the default Windows Notepad like above, enter the application before the filename. For example, because we have Notepad++ installed, enter “notepad++ test.txt.” This is the same as right-clicking a file and choosing what program to use for an opening.


This method of launching is useful for searching for files as well as quickly opening them. For example, a folder like “%windir%\system32” is full of files and other folders. Quickly search for and enter a folder or file by beginning to type the name and then clicking the result in the drop-down menu. You’ll essentially be sending a launch command via this Explorer window.


Even regular switches used in the command prompt can run right from any Explorer location. Say you want a list of all files and folders under a folder of pictures.

Navigate to the folder:


Run “cmd /k dir.”


This launches a command window that lists the directory as plain as day.


Again, the result is the same when beginning from the command line, like below, but executing the change directory command (“cd”) is needed to focus on the correct folder.


You can see how easy and beneficial running commands from a current directory can be. Explore this yourself and let us know if you find any cool tricks we didn’t mention.