Files
dedinit.ru/content/posts/20171104 - udalenie-sluzhby-s-pomoshchyu-powershell/index.md
T
2026-10-04 19:01:00 +00:00

34 lines
1.7 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
date: '2017-11-04T18:47:00+03:00'
lastmod: '2017-11-04T18:47:00+03:00'
draft: true
title: 'Удаление службы с помощью Powershell'
slug: 'udalenie-sluzhby-s-pomoshchyu-powershell'
categories:
- 'powershell'
tags:
- 'blog'
cover:
image: "hero.svg"
alt: "Удаление службы с помощью Powershell"
---
![](img-1.png)
Подхватил недавно Adware которые насоздавал кучу лишних служб, таких как updater.mail.ru. Конечно, в состав Windows 10 входит отличная утилита SC с помощью которой их легко можно удалить:
 sc delete updater.mail.ru.
Но удивил тот факт что в составе Powershell есть командлеты для создания, настройки и управления службами, но вот для удаления нет.  Есть костыли использующие WMI
(Get-WmiObject win32_service -Filter ″name=′updater.mail.ru′″).delete()
или прямое удаление ветки реестра относящийся к службе в разделе:
HKLM:\SYSTEM\CurrentControlSet\Services\
но вот командлета нет. Искал на powershelgallery.com и в стандартной поставке. Отличный пример когда соберусь изучать создание командлетов. наверняка это из-за каких-подводных камней. хотя конечно можно просто обёртку для sc.exe написать, что совсем не интересно.