- File Explorer command line arguments in Windows 10
- About Sergey Tkachenko
- 7 thoughts on “ File Explorer command line arguments in Windows 10 ”
- How To Open Windows File Explorer In Different Ways like Shortcut, Command-line, GUI?
- Open File Explorer Keyboard Shortcut
- Open File Explorer From Taskbar
- Open File Explorer Search Box
- Open File Explorer From Cortana
- Open File Explorer WinX Menu
- Open File Explorer Start Menu
- Open File Explorer From Desktop Shortcut
- Open File Explorer PowerShell
- Open File Explorer Task Manager
- Open File Explorer Run Window
- Open File Explorer MS-DOS Command Line
- Open Command Prompt in Folder Using Windows Explorer
- Command Prompt vs PowerShell
- Open Command Prompt Using the Explorer Address Bar
- Adding “Open command window here”
- Opening The Command Prompt Using Windows Explorer
- You’re In Command Now!
File Explorer command line arguments in Windows 10
File Explorer is the default file management application which comes bundled with every modern version of Windows. It allows the user to perform all basic file operations like copy, move, delete, rename and so on. It supports a number of command line arguments (switches) which can be useful in various scenarios. It’s good to know them.
Before you proceed: You can test these arguments by opening the Run box ( Win + R ) or a command prompt instance. There you can type the commands described below.
explorer.exe /n,folder_path
The switch «/n» makes File Explorer open a new window with the specified location selected in the navigation pane. If you omit the folder path, Windows 10 opens the Documents folder with This PC selected on the left or Quick Access. In very old Windows versions like XP, this switch made Explorer open a new window without the folder tree on the left. In Windows 10, 8, 7, it does not hide the left area.
explorer.exe /e,folder_path
The /e switch opens Windows Explorer expanded to the specified folder. In very old Windows versions like XP, this switch made Explorer open a new window with the folder tree on the left expanded to the specified folder. In Windows 10, it has exactly the same behavior as the «/n» switch mentioned above unless you enable the option «Expand to current folder».
explorer.exe /root,folder_path
Opens File Explorer with the specified folder as the root (topmost item in the breadcrumbs bar). For example, to open the folder «C:\apps\firefox beta», I need to execute the following command:
When a folder is opened as root, Alt + Up no longer works to go up one level.
The specified location will appear as a separate item in the navigation pane on the left.
explorer.exe /select,file_or_folder_path
This switch tells File Explorer to open with the specified file or folder selected in file view (right pane). For example, to open the folder «C:\apps\firefox beta» with firefox.exe selected, I need to execute the following command:
The result will be as follows:
explorer.exe /separate
The explorer.exe application supports a secret hidden command line switch /separate. When specified, it forces Explorer to run in a separate process. This will open a new Explorer window directly in a separate process.
To check how many instances of Explorer you have running in a separate process, open Task Manager and go to the Details tab.
I covered this switch in detail in the following article: How to start File Explorer in a separate process in Windows 10.
That’s it. Feel free to leave a comment if you have a question or know more command line tricks with File Explorer.
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
Share this post
About Sergey Tkachenko
Sergey Tkachenko is a software developer from Russia who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.
7 thoughts on “ File Explorer command line arguments in Windows 10 ”
Hi, thanks for that brilliant reference information!
Additional questions:
Can Windows-Explorer be forced to sort by “Date modified” (or other) when opend?
Can Windows-Explorer be forced to open in Detail-View?
That would be great?
Thanks a lot and kind regards
Rudi
These switches do not work if you are trying to open a folder on a different drive letter. If explorer is on the C: drive but you want to open a folder on the D: drive these switches do not work.
C:\Windows\explorer.exe /n,”D:\Drivers\network” – will not work
Nevermind, must have been some sort of typo because I got it to work
How do you open File Explorer with “This PC” selected?
Never mind. I finally discovered: Explorer.exe /n,
It’s important to include the comma with nothing after.
If you just specify /n it goes to Documents.
What Rudi said! Open in Details view and sorted by mod date!!
At least the Microsoft Deproductivity Department hasn’t prevailed in preventing the folder from remembering how you last set it — thus you only have to set in once, per folder. But as Rudi asks, I would like to “ensure” those settings as I invoke from the command line.
Is it just me, or is there not a single date on the page – on the article, the comments, the URL? Dates are often vitally significant for technical pages.
How To Open Windows File Explorer In Different Ways like Shortcut, Command-line, GUI?
File Explorer is one of the most used tool or application on Windows operating systems. File Explorer can be used to open file, directory, edit file, copy, paste etc. In this tutorial, we will learn how to open file explorer in different ways in different Windows operating systems like Windows 7, Windows 8, Windows 10, Windows Server 2008, Windows Server 2012, Windows Server 2016.
Open File Explorer Keyboard Shortcut
We will start with the keyboard shortcut which will open the File Explorer immediately. We will use the windows key and E to open File explorer immediately.
Open File Explorer Keyboard Shortcut
Open File Explorer From Taskbar
By default recent Windows operating system versions like Windows 7, Windows 8, Windows 10 and Windows Server versions offer File Explorer shortcut on the taskbar. We can open File Explorer from taskbar with a single click.
Open File Explorer From Taskbar
Open File Explorer From Taskbar
Open File Explorer Search Box
Search Box provides an easy way to access different tools, features of the Windows operating system. We can use Search Box which is opened from the start menu to open File Explorer.
On Windows 7 operating systems File explorer is named as Windows Explorer which should be used as the name of the File Explorer like below.
Open File Explorer Search Box for Windows 7
Open File Explorer Search Box for Windows 8 , 10
Open File Explorer From Cortana
Cortana is an assistant which can be used to manage and use computers by our voice. We can use Cortana in order to File Explorer. We just need to open Cortana from Task Manager and say
Open File Explorer From Cortana
Open File Explorer WinX Menu
WinX menu can be used to open File Explorer. WinX menu can be opened two different ways. First, we can open WinX menu by using WindowsKey+X and secondly we can open it clicking right to the Start Menu.
Open File Explorer Start Menu
Start Menu provides a lot of short cut for different tools. We can open File Explorer from Start Menu. In Windows 7 it is named as Windows Explorer.
Open File Explorer From Desktop Shortcut
Shortcuts provide an easy way to access tools or run commands in Windows operating system. We can create a shortcut for File Explorer in order to run with a single click.
Right Click to the Desktop and
Then we will write explorer which is the executable name of the File Explorer.
In this following screen, we will set a name for the shortcut. We can use whatever name we want but we use File Explorer in this example.
In the following screen we can see the created File Explorer shortcut.
Open File Explorer PowerShell
PowerShell is a generation command line for Windows operating systems. We can use PowerShell in order to open File Explorer. We will use explorer command like below.
Open File Explorer Task Manager
Task Manager provides listof process running on the system with resource usage like CPU, Memory, Disk IO, Network. We can run new task from Task Manager which can be File Explorer too. We will click File -> New Task and write explorer .
Open File Explorer Task Manager
We will run explorer command like below.
Open File Explorer Run Window
Run Window is used to run commands and binaries. We can use to open file Explorer with the explorer command like below. We can open Run Windows with Win+R or from Start Menu like below.
and run following command
Open File Explorer MS-DOS Command Line
MS-DOS is the old friend of the command liners. We run explorer command on the MS-DOS command line prompt. We will open MS-DOS from Start Menu like below.
and then use explorer command.
Open File Explorer MS-DOS Command Line
Open Command Prompt in Folder Using Windows Explorer
Who wants to type out the full path?
The Command Prompt is an incredibly useful way to perform certain tasks. For example, if you want to run a program with special parameters, the Command Prompt is one fast way to do it. The problem is that navigating the directory structure of a modern computer can be a real pain when using Command Prompt. Especially since Windows 10 supports such long folder and program names.
The good news is that you can open Command Prompt directly from inside a Windows Explorer window. Taking you directly to that folder location!
Command Prompt vs PowerShell
One important point about opening the command prompt in a folder, is that we’re referring specifically to the Windows Command Prompt, rather than PowerShell. Although both programs look similar, being a text-command interface, they are actually very different.
Command Prompt is a simple, lightweight text interface for Windows. In contrast, PowerShell is a complex, powerful command line tool that lets power users do in-depth system management of the computer, among a long list of other handy abilities.
Command Prompt uses the “CMD.exe” while PowerShell uses “powershell.exe”, so they are entirely separate. Although some of the functionality overlaps, the two programs may use different commands to accomplish the same job. This article is only about the Command Prompt, but some of the shortcuts will also work for PowerShell. We’ll indicate when this is the case.
Open Command Prompt Using the Explorer Address Bar
When you open a Windows Explorer folder, you’ll see an address bar similar to that in a web browser. By default, it shows the path of the current folder. You can see it here.
If you click on this address bar, you can type in text. By typing “cmd” and hitting Enter, you’ll open up the command prompt at that location.
This will also work if you type “powershell” instead of “cmd”. Taking you directly to the Windows PowerShell prompt at that folder.
Adding “Open command window here”
In early versions of Windows 10, there was a context menu entry called “Open command window here” which would open the Command Prompt in the folder location you specify. For example, if you right-click on a folder and use this command, the Command Prompt starts at the current folder location.
After the 2017 Creator’s Update for Windows 10, Microsoft removed this option. Why? It’s most likely down to an effort from Microsoft to push people away from using the Command Prompt towards using PowerShell.
Getting this command back is not very difficult, but it does require some tinkering in the Windows Registry. If you don’t feel comfortable doing that, it’s best to skip this method, but if you really want that context menu option back, here’s what to do.
First, click Start and type regedit. Then click on the regedit program entry.
With the registry editor open, look for the following registry key at this path:
HKEY_CLASSES_ROOT\Directory\shell\cmd
This is where things might start to feel a little risky, but we aren’t doing anything that will break your computer. But make sure you follow these exact instructions!
Right-click on the key and click Permissions in the context menu.
In the dialogue box that opens up, click Advanced.
At the top of the advanced settings window, you’ll see the listed owner of the key. Click the Change option.
Next, type your username and then click check names to validate it. Then click OK.
Finally, make sure the Replace owner on subcontainers and objects box is selected before clicking OK.
Now we’re back on the permissions page. Select Administrators under Group or user names and select Allow next to Full control. Then click OK.
Now we have to restore the context menu entry for the Command Prompt.
Back inside the CMD window, all we have to do is change the “DWORD” from “HideBasedOnVelocityiD” to “ShowBasedOnVelocityId”. Just right-click on it and choose rename, then change the name of the DWORD.
If all has gone as planned, you should now see the “Open command window here” option, when you SHIFT+right-click an item in the Windows Explorer window.
Opening The Command Prompt Using Windows Explorer
This next method of opening the Command Prompt from a Windows Explorer window involves navigating to where the Command Prompt program itself is stored and running it directly from there. This is still useful when, for one reason or another, other means of opening Command Prompt don’t work.
You can find “cmd.exe” in C:\Windows\System32. If you want to run it with administrative privileges, simply right-click cmd.exe and choose Run as administrator. There are plenty of commands that require administrative privileges to work and this is one of the ways you can start the Command Prompt with those privileges without leaving Explorer.
You’re In Command Now!
As they;ve done with HyperTerminal, Microsoft may choose to one day completely phase out Command Prompt, in favor of PowerShell. While that’s not a bad thing in itself, PowerShell could do with some polish to help non-power users who would have been fine with the Command Prompt to use common functions just as easily. Still, until the day Command Prompt actually does go the way of the Dodo, you can rest assured it’s only a few clicks away.
If you need to improve your Command Prompt skills, then why not check out these 21 commands that every Windows user should know. You’ll be flying through tasks in no time armed with these incredibly useful tricks.
Sydney Butler is a social scientist and technology fanatic who tries to understand how people and technology coexist. He has two decades of experience as a freelance computer technician and more than a decade as a technologies researcher and instructor. Sydney has been a professional technology writer for more than five years and covers topics such as VR, Gaming, Cyber security and Transhumanism. Read Sydney’s Full Bio