Powertoys: [Launcher] Ability to execute system/OS commands like shutdown

Created on 26 Apr 2020  路  15Comments  路  Source: microsoft/PowerToys

As per this twitter conversation, it would be nice to have the ability to execute system commands such as sleep, shutdown ,and switch user account from within the launcher via the use of friendly keywords.

Some keyword examples:
"sleep" - send the PC to sleep
"hibernate" - send the PC to sleep
"shutdown" - shut the PC down
"switch user" - switch user account

As current if we search for Sleep from within Windows Search we are only given the option to view Sleep and power settings. It is possible to run such commands from Win + R, although our command will instead look like this rundll32.exe powrprof.dll,SetSuspendState 0,1,0, not quite user friendly to be honest! :)

Screenshot taken from the twitter conversation showing how we could prioritize the UI for common Windows system commands above the search result.

image

Help Wanted Idea-Enhancement Product-Launcher Resolution-Fix-Committed

Most helpful comment

I've done this as a workaround for now:

Using similar and identical commands as posted above. Added a /f to most.
I can just type them and for those who don't show up at the top I can start with /<command> instead.
Works perfectly!
Make sure to put these in folders that are getting indexed.
You can pretty much do anything this way.

All 15 comments

This is a great idea. We have a plugin based architecture so this should be possible.

There is a launcher?
EDIT: What do you mean? The settings thing? Or am I missing something?

It is coming in 0.18 :)

Any way to test out the launcher?

Clone master or wait a few days :)

Clone master or wait a few days :)

Any idea how many days ;p ?
And... If I where to clone from master, will there be nonfunctional features? Or only features that are all made?

I really would like to implement this feature. Should this be implemented inside the Shell Plugin of the launcher or in a sperate one? Because these are system commands.

This is a great idea. We have a plugin based architecture so this should be possible.

Is there an SDK that 3rd-party devs can work against to provide plugins? Or at least documentation on existing arch? A quick scan of the repo didn't highlight anything for me? This would also relate to my feature request: https://github.com/microsoft/PowerToys/issues/3622

instead look like this rundll32.exe powrprof.dll,SetSuspendState 0,1,0

@TheXamlGuy I want this feature as much as you do; just if it helps: you can achieve reboot, hibernate, log off and power-off with shutdown.exe:

  • reboot: shutdown -t 0 -r
  • hibernate: shutdown -t 0 -h
  • power-off: shutdown -t 0 -s
  • log off: shutdown -t 0 -l

the -t 0 means "just do it, don't show a warning and wait 30 seconds"

It's not ideal, but I hope it helps someone else. This is in my MRU for win+r :D

I've done this as a workaround for now:

Using similar and identical commands as posted above. Added a /f to most.
I can just type them and for those who don't show up at the top I can start with /<command> instead.
Works perfectly!
Make sure to put these in folders that are getting indexed.
You can pretty much do anything this way.

(thumbs-down isn't for the efforts of @GreenMan36 but because this hack has to be in place to provide simple functionality)

@GreenMan36 glad you found a workaround; until the perf and basic functionality issues are resolved, I'm back on KeyPirinha. It's not opensource, but, like Linus, I prefer stuff that works over ideals :/

, I'm back on KeyPirinha. It's not opensource, but, like Linus, I prefer stuff that works over ideals :/

Use what works for you. We are still in preview and adjusting a lot. .19 should have some pretty big perf tweaks and tons of stability issues resolved.

TLDR: can someone help port https://github.com/Wox-launcher/Wox/tree/master/Plugins/Wox.Plugin.Sys and we should get this ability

@crutkas I'd like to tackle this port from Wox if that's okay? Honestly, my most used plugin. ETA for PR, end the week?

@enricogior This should be in Done not in To do

Was this page helpful?
0 / 5 - 0 ratings