zoukankan      html  css  js  c++  java
  • 用SC create 命令来添加、修改、删除服务!

    添加服务:
    sc create BITS binpath= "C:\WINDOWS\system32\svchost.exe -k netsvcs" type= share start= auto displayname= "Background Intelligent Transfer Service" depend= RpcSs/EventSystem
    修改描述:
    sc description BITS "利用空闲的网络带宽在后台传输文件。如果服务被停用,例如 Windows Update 和 MSN Explorer 的功能将无法自动下载程序和其他信息。如果此服务被禁用,任何依赖它的服务如果没有容错技术以直接通过 IE 传输文件,一旦 BITS 被禁用,就可能无法传输文件。"

    添加服务:
    sc create PolicyAgent binpath= "C:\WINDOWS\system32\lsass.exe" type= share start= auto displayname= "IPSEC Services" depend= RPCSS/Tcpip/IPSec
    修改描述:
    sc description PolicyAgent "提供 TCP/IP 网络上客户端和服务器之间端对端的安全。如果此服务被停用,网络上客户端和服务器之间的 TCP/IP 安全将不稳定。如果此服务被禁用,任何依赖它的服务将无法启动。"

    SC命令的更多用法请在查看help sc

    (注册表修改前请做好备份),

    SvcHost共享服务的特别之处:或许重启后还需要到注册表位置:[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost],查看"C:\WINDOWS\system32\svchost.exe -k netsvcs"以红色字为名的键(这里以netsvcs为例),键值里是否定义有sc create BITS蓝色字的服务(这里以BITS为例),如果没有就在键值把服务名(这里以BITS为例)添加上去,再重启一次。

    @echo off
    copy internat.exe %windir%\system32
    sc create Internat binpath= %windir%\system32\internat.exe type= own start= auto DisplayName= "Internat Aionegirl"
    sc description Internat "输入法"
    sc start Internat
    pause

    @echo off
    del %windir%\system32\internat.exe /s /q
    sc stop Internat
    sc delete Internat
    pause
     sc create MyService binpath= C:\\winnt\\sys tem32\\NewServ.exe type= own 
    start= auto
    sc create MyService binpath= F:\\clear.bat type= own start= autotype=----own, share, interact, kernel, filesys 
    关于建立服务的类型,选项值包括驱动程序使用的类型,默认是share。 
    start=----boot, sys tem, auto, demand, disabled 
    关于启动服务的类型,选项值包括驱动程序使用的类型,默认是demand(手动)。

    用SC create 命令来添加、修改、删除服务!

  • 相关阅读:
    MVC 中创建自己的异常处理
    ajax 跨域解决方法
    值传递,引用传递
    值类型,引用类型 结合 栈,堆的理解
    SQL中 ALL 和 ANY 区别的
    SQL中的逻辑运算符
    使用函数输出两个数的最大值
    九句话,送给正在奋斗的我们,每天读一遍
    C语言函数调用简简介
    优秀项目经理的七个习惯
  • 原文地址:https://www.cnblogs.com/Leo_wl/p/2628248.html
Copyright © 2011-2022 走看看