PowerToys
PowerToys copied to clipboard
[Run] Launching a process starts it in `c:\Program Files\PowerToys` (default working directory)
Environment
Windows build number: `_dep.200508`
PowerToys version: 0.18
PowerToy module for which you are reporting the bug (if applicable): Launcher
Steps to reproduce
- Configure your default profile in the Windows Terminal to not have a
startingDirectory, so that the Terminal will use your current path as the starting directory. - Run
> wtto launch the terminal
Expected behavior
When I run programs in the Win+R run dialog, they use C:\windows\system32 as the CWD.
This is probably expected, but I was definitely a little surprised. I think the best solution might be letting the user set the CWD to use for launched processes, instead of defaulting to ...\PowerToys\
we should make it behave correctly but as this is an end user changed option, we are moving this out of the stability push
Suggestion: Set the working directory of the started program to the top-most open explorer.exe path.
Moved here from #7531
I have a slightly different slant on what is probably the same cause.
I have the WT setting startingDirectory set to a value that is my user home directory in the WSL distro (i.e. ~).
This works as expected when launching WT via the classic Run box, or from a shortcut.
Yet when I use power launcher to launch WT it opens to my windows user profile (the default), completely ignoring the setting.
Incredibly frustrating as I rarely, if ever, wish to work from that directory.
The only solution I see to date is to stop using Power Launcher. As Power Launcher is the only Power Toy I use, it probably means uninstallation is in the near future 🙁 .
Shouldn't the best solution be to make apps behave as if they were launched from a terminal window or the explorer?
That is, the CWD is the path where the executable is located at.
If I open a folder in explorer and double click on an executable, the CWD will be the exe's directory.
Same when cd-ing into a directory and launching the exe from there.
PowerToys Run should to the exact same imo, launch it as if the user "double-clicked" the executable.
There could also be an option to set a custom CWD per executable, but that would be a new feature...
Not IMO. How the application is launched should respect that applications settings about how it is launched.
That is, if I have specifically configured an application's setting that I would like that application to start in a particular way then, irrespective of what other application starts it, that configuration should be respected.
Not IMO. How the application is launched should respect that applications settings about how it is launched.
Of course. But any application that isn't specifically configured, and simply makes use of the current working directory, should behave as I described above, shouldn't it?
Setting the CWD to the install location of PowerToys simply makes no sense, especially because the location requires elevated permissions for file system access...
@zadjii-msft can you share the WT profile, since I haven't been able to reproduce the problem you described. Thanks.
@wolf99
can you please provide detailed repro steps and post the exact profile configuration you are using?
Does it not work for you just when using the user home directory in the WSL distro (i.e. ~) or for any value of startingDirectory?
Sorry, I have uninstalled power toys.
However my WT settings has the following in the WSL profile: "startingDirectory": "//wsl$/Ubuntu/home/{my username}",.
IIRC the only setting I changed from non-default in the power toys setting was to change the shortcut key that launches the Run tool.
Addition to @keombre 's suggestion:
Set the working directory of the started program to the top-most explorer.exe's path, if and only if an explorer.exe window is the topmost window. Furthermore, some programs ignore the working directory and instead want the path to be passed as an argument. I'd love it if that were addressed in some way as well.
Is this still an issue with the latest version?
Has this been addressed? This feature would greatly increase workflow for me and maybe others.
This is the only launcher that does not use the application path as the current working path. In most cases, this invalidate the usefulness, especially for portable applications that store data in the installation directory. Launchers are most useful to launch portable apps (without registering in Start menu) It's a pity, because the launcher is one of the best in terms of convenience and interface.