博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Add&Delete WindowService
阅读量:7157 次
发布时间:2019-06-29

本文共 1541 字,大约阅读时间需要 5 分钟。

Part One-Add:

Step4: Add the new service to windows service:

$commandLine = 'D:\IMS\2.16.0.42-DataServices\Service\Eze.Shell.exe -r=ziyezhang_22'

New-Service -Name 'EzeImsService_22_test' -BinaryPathName $commandLine -StartupType Automatic

 

Part-Two Delete:

ref:http://www.cnblogs.com/liuzhendong/archive/2011/05/12/2044629.html

How to delete a windows service 

 

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.

原文: 

转载于:https://www.cnblogs.com/purple1/p/4498358.html

你可能感兴趣的文章
C#中海量数据的批量插入和更新
查看>>
使用C++判断两矩形是否相交
查看>>
Yahoo!网站性能最佳体验的34条黄金守则——服务器
查看>>
界面视频通话视频通话最新谍报
查看>>
我的第一次面试经历
查看>>
表格行mouse经过时高亮显示
查看>>
【GoLang】GoLang 官方 对 error 处理的意见
查看>>
MVC 5使用ViewData(对象)显示数据
查看>>
错误处理与调试 (14 章 )
查看>>
ytu 1985:C语言实验——保留字母(水题)
查看>>
java常见错误--Access restriction: The type BASE64Encoder
查看>>
Mybatis 对象关系映射之一对多 and 多对多 关系
查看>>
周下载量过 200 万的 npm 包被注入恶意代码,Vue等 项目恐受影响
查看>>
[译] 高性能 Java 缓存库 — Caffeine
查看>>
[译] 用 API 请求制作赏心悦目的 UX
查看>>
# 闲谈 Objective-C 与 Swift
查看>>
iOS购物车商品加减逻辑(附赠block块使用)
查看>>
通用 Gradle打包混淆Jar, 合并第三方引用的Jar (Gradle 3.0)
查看>>
python性能优化之函数执行时间分析
查看>>
原生JS实现最简单的图片懒加载
查看>>