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. n switch

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

e switch expand to current folder enabled

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.

root switch 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: select switch

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. separate switch

To check how many instances of Explorer you have running in a separate process, open Task Manager and go to the Details tab.

separate switch task manager 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.

3 thoughts on “File Explorer command line arguments in Windows 10

  1. Rudi Radler

    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

    Like or Dislike: Thumb up 2 Thumb down 0

    Reply
  2. Rich

    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

    Like or Dislike: Thumb up 0 Thumb down 0

    Reply
    1. Rich

      Nevermind, must have been some sort of typo because I got it to work

      Like or Dislike: Thumb up 0 Thumb down 0

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *