Powertoys: [pt run] Be able to start/stop services

Created on 20 Aug 2020  路  12Comments  路  Source: microsoft/PowerToys

馃摑 Provide a description of the new feature

I wish to be able to search for a service by name (like MySQL) and be able to start or stop it.


If you'd like to see this feature implemented, add a 馃憤 reaction to this post.

Help Wanted Idea-Enhancement In progress Product-Launcher Run-Plugin

Most helpful comment

I have created a simple POC for a Launcher Plugin that handles Windows Services using System.ServiceProcess.ServiceController.

Start/Stop a service should be an async operation that should't block the UI but I am not sure if a context menu actions can be asynchronous.

Service

All 12 comments

Interesting idea

Two things we should have on mind:

  • We should be able to search by short and long name.
  • The plugin the should run elevated. Normal users are not allowed to manage service.
  • Restarting services should be also possible. _(Added 2020-08-22 07:43 PM, MESZ)_
  • We should be able to search by short and long name.

By short and long name you say the name displayed in services list, like Windows Update and the short name would be wuauserv?
That would be useful.

I have created a simple POC for a Launcher Plugin that handles Windows Services using System.ServiceProcess.ServiceController.

Start/Stop a service should be an async operation that should't block the UI but I am not sure if a context menu actions can be asynchronous.

Service

I have created a simple POC for a Launcher Plugin that handles Windows Services using System.ServiceProcess.ServiceController.

Start/Stop a service should be an async operation that should't block the UI but I am not sure if a context menu actions can be asynchronous.

Service

Do people need admin rights to use the plugin?

Can people search for the full name (in your example: SQL Server (MSSQLSERVER)) too?

BTW: I think you can create a PR for your poc and mark it as draft.

@htcfreek

  • Yes, without admin rights only can only listing services.
  • Yes, you can search both.

Will fix/review the code and will make a draft PR this week.

@htcfreek

  • Yes, without admin rights only can only listing services.

How does it work with the admin rights? Does the user see a UAC dialogue or does PT Running with admin privileges?

  • Yes, you can search both.

Does it make sense to show both names like this:


Microsoft SQL Server
MSSQLSERVICE - Running


@davidegiacometti
For the icon we should use one of the following ideas, I think:

  1. Create an flat black/white icon based on the official services icon.
  2. Create an flat black/white icon based on the app symbol and the settings symbol in MDL2 Assets font.

cc: @niels9001

This would be a neat addition. No matter what, PT Run is under non admin so this could act I'd assume like launching an app under admin rights with the UAC prompt.

This would be a neat addition. No matter what, PT Run is under non admin so this could act I'd assume like launching an app under admin rights with the UAC prompt.

Since PT Run isn't running elevated I think we can use ServiceController just to query services and statuses, but for start/stop/restart we will need to start an elevated elevated net start/net stop.

This would be a neat addition. No matter what, PT Run is under non admin so this could act I'd assume like launching an app under admin rights with the UAC prompt.

Since PT Run isn't running elevated I think we can use ServiceController just to query services and statuses, but for start/stop/restart we will need to start an elevated elevated net start/net stop.

As I stated out in #1605, in our company the uac is disabled. So it would be great to have a setting for switching from "uac mode" to "other user mode".
I think this could be a general PT Run setting to use in other plugins too. This should not mean that we rework other plugins now. But we could provide the setting now as general setting and other plugins can later use it too. (For example: Registry.)

Development of this plugin is now in progress: #8076

馃帀 馃コ

Was this page helpful?
0 / 5 - 0 ratings