[Solved] How to delete a Windows service in service window? Access deny - Slash Engineer 要多斜有多斜

Breaking

Slash Engineer 要多斜有多斜

程式設計的學習過程 (環境設置、開發環境、程式設計、語法練習、資料結構等等...) 99'暑假:六月初開始. 社會新鮮人:十一月初開始.

2020年2月19日 星期三

[Solved] How to delete a Windows service in service window? Access deny


A customize Windows server cannot uninstall even PowerShell login with Administrators.

When I try to delete a Windows service, the error message shows me "Access deny".

I have tried this command --> sc delete "Service Name"
But it's still not working.

Finally, it was solved after I found this solution.
1. Using PowerShell(Run as Administrators)
2. then assign a parameter to store the service object.
3. execute the delete method.

Thanks to the reference link.


$service = Get-WmiObject -Class Win32_Service -Filter "Name='servicename'"
$service.delete()


Ref:
https://www.winhelponline.com/blog/how-to-remove-unwanted-service/

沒有留言:

張貼留言

問題沒有大小或好壞