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.

You can use File Explorer command line arguments in shortcuts, in batch files, in VB scripts or from PowerShell. In Windows 10, the application supports the following command line arguments.

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:

explorer.exe /root,"C:\apps\firefox beta"

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:

explorer.exe /select,"C:\apps\firefox beta\firefox.exe"

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.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer 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.

8 thoughts on “File Explorer command line arguments in Windows 10”

  1. 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

  2. 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

  3. 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.

  4. 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.

  5. 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.

  6. This concept confuses switches with arguments. Arguments are command line data ment to be accesses by the application being called, such as a script using the Arguments property to retrieve data from the command line needed by the script to accomplish a task particular to that script..

    Switches will not accomplish this, File Explorer uses them to do a limited number of things about running the program. This information is never available to the app being run.

    While the command line being run as cmd accepts actual arguments , the Windows Run input box will not. And that is part of the problem in need of a solution.

Leave a Reply

Your email address will not be published.

Exit mobile version
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.