question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Launching explorer.exe with arguments just opens explorer.exe

See original GitHub issue

Ok title might be a little misleading…

if you execute explorer "C:\Users" or something like this in CMD or another program calls it this way (i.e. Steam) It just opens regular explorer.exe and not Files even when the guide for making Files the default explorer is followed as intended

Expected behavior Files should open in the desired directory when executing explorer "Directory"

Logfile No logfile necessary

This is a small issue but quite annoying

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BanCrashcommented, Jun 16, 2021

This is so odd, I used your command but even with that still writing explorer.exe on cmd opens files.exe

I used the registry key to make files as default explorator, but I think this doesn’t happened before…

EDIT: Yep, using the other registry file to unset files solve the issue. My bad, sorry.

0reactions
JotaRatacommented, Jun 16, 2021

Nevermind I found the solution!

There’s no need to modify explorer.exe binaries, instead you can follow this guide to set an alias for explorer and set it to Files

First you need to include the path where Files.exe is located (C:\Users\NAME\AppData\Local\Microsoft\WindowsApps) to PATH You create a bat or cmd file (ie Alias.bat) and save it somewhere, here you write:

@echo off set PATH=%PATH%;"C:\Users\NAME\AppData\Local\Microsoft\WindowsApps" doskey explorer=files.exe $*

Now the bat file creates an “alias” for explorer, but this only last until the cmd window is closed that’s less than a second To make it persistent you need to create a new string keyword in the registry at:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor

with the name AutoRun and set the path to the bat file you created.

And that’s it! Now everytime you call explorer.exe form CMD using arguments it should open Files in the specified folder.

If you can add this guide somewhere it would be nice

Hello @JotaRata , I tried your solution but It doesn’t work for some programs that still launch explorer.exe. How can I unmade those changes? I tried restarting computer, but it doesn’t work.

I didn’t create the registry key, but the change seems to be permanent.

Regards and thanks.

It’s not permanent, the DOSKEY command is only active for the current session of CMD, if you close it, it’s gone. The AutoRun key In the registry only references the bat file you created, so in order to disable it just remove the file

Now if for some reason you still have explorer mapped to files.exe, just write

doskey explorer=explorer.exe

Read more comments on GitHub >

github_iconTop Results From Across the Web

When opening an executable using explorer.exe, how do I ...
The best way I found to achieve this was to create a batch file containing the call for the executable with the parameters...
Read more >
c# - Open an Explorer window with Process.Start creates ...
However, if I were to start just the explorer.exe with no 2nd argument, an extra explorer.exe process will not be created even though...
Read more >
Parameter "/root" of explorer.exe not working anymore?
Hi Folks. I used to call explorer.exe /e,/root,%myfolder% to open an explorer-window to "myfolder" with a navigation panel starting with ...
Read more >
Explorer.exe - Windows CMD
Syntax Explorer.exe options Options /n Open a new single-pane window for the ... /separate Launch an explorer instance as a separate process (undocumented ......
Read more >
File Explorer command line arguments in Windows 10
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 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found