How to delete a windows service

本文介绍了一种手动删除Windows服务的方法,通常情况下卸载应用程序会自动删除相关服务,但某些特殊情况可能需要手动操作。文章提供了通过注册表编辑器或命令提示符进行删除的具体步骤。
Recently, I was trying to delete a windows service. Normally it should not be necessary to manually delete a service. Uninstalling an application should remove its associated service (if any).

However, I installed some beta products and a service created by one of the applications was not removed automatically. Its very easy to remove a service from registry if you know the right path. Here is how I did that:

1. Run Regedit or Regedt32

2. Find the registry entry "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services"

3. Look for the service there and delete it. You can look at the keys to know what files the service was using and delete them as well (if necessary).

alternatively, you can also use command prompt and delete a service using following command:

sc delete < SERVICE name>

or to create, simply type
sc create <SERVICE name>

Update:
If you have space in the file path you need to use quotation marks ("). For example:
sc create "MySQL" binpath= "C:\Archivos de programa\MySQL\MySQL Server 5.1\bin\mysqld.exe"

Thanks to Maya.

NOTE: You may have to reboot the system to get the list updated in service manager.

ZT FROM
http://geekswithblogs.net/shahedul/archive/2006/10/13/93984.aspx
### 如何在 Windows 上安装 Intel Performance Counter Monitor (PCM) 要在 Windows 系统上成功安装并使用 Intel Performance Counter Monitor (PCM),需要遵循特定的步骤来确保其正常运行。以下是对安装过程的具体说明: #### 安装前准备 在开始安装之前,需确认系统满足以下条件: - **操作系统支持**:确保您的 Windows 版本兼容 PCM。通常,Windows 7、Windows Server 2008 R2 及更新版本被广泛支持[^2]。 - **Microsoft .NET Framework**:自 PCM 1.5 版本起,软件包集成了基于 Microsoft .Net* 2.0 或更高版本的服务。因此,在安装 PCM 服务之前,请先验证系统是否已安装所需版本的 .NET Framework。 #### 下载与解压 1. **下载 PCM 工具包** 访问官方资源页面获取最新版 PCM 软件包[^1]。下载完成后将其保存到本地计算机的一个易于访问的位置。 2. **解压缩文件** 使用合适的解压工具打开下载好的 ZIP 文件,并将其中的内容提取至指定目录(例如 `C:\intel\pcm`)。此操作会生成若干子文件夹以及必要的可执行文件和文档。 #### 配置服务 为了使 PCM 数据能在 Windows 自带的性能监视器 (`Perfmon`) 中展示出来,必须正确设置相关联的服务。 1. **阅读指导手册** 查阅随同分发包一起提供的 `Windows_howto.rtf` 文档,它包含了详细的安装指南和服务管理指令[^2]。 2. **注册服务** 打开命令提示符窗口(建议以管理员身份运行),导航至刚才解压后的路径下的适当位置(通常是 `\bin` 子目录下找到对应的脚本或批处理文件)。接着输入类似下面这样的命令完成服务登记工作: ```cmd install_service.bat ``` 3. **启动服务** 同样通过 CMD 输入相应控制语句激活刚刚建立起来的新后台进程: ```cmd net start pcm-service ``` 4. **验证安装状态** 返回 Perfmon 应用界面查看新增加的部分选项卡里是否有来自 PCM 提供的信息条目存在即可判断整体流程是否顺利完成[^2]。 #### 测试安装效果 利用所提供的测试案例代码片段编译链接成独立的应用程序形式进一步检验实际部署成果的有效性[^4]: ```cpp /* filename: test.cc */ #include <iostream> #include <cstdint> #include "cpucounters.h" using std::cout; int main(void) { // 新建一个PCM实例 PCM* pcm_ = PCM::getInstance(); auto status = pcm_->program(); const int TEST_SCALE = 10000; int * arr = new int[TEST_SCALE]; uint32_t check_sum = 0; // 我们希望监控整个系统的硬件数值 SystemCounterState before_sstate = getSystemCounterState(); for(int i = 0; i < TEST_SCALE; i++) { check_sum = (check_sum + arr[i]) % (1 << 16 - 1); } SystemCounterState after_sstate = getSystemCounterState(); // 获取区间内的统计数值 cout << "\tL3 misses: " << getL3CacheMisses(before_sstate, after_sstate) << "\n" << "\tDRAM Reads (bytes): " << getBytesReadFromMC(before_sstate, after_sstate) << "\n" << "\tDRAM Writes (bytes): " << getBytesWrittenToMC(before_sstate, after_sstate) << "\n"; delete []arr; return 0; } ``` 以上即为完整的 Windows 平台上的 Intel PCM 设置方法概述。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值