文章目录

  • powershell_进程任务管理/服务管理/(查看/关闭/停止/移除&windows移除mysql服务
    • references
    • 获取软件版本
      • 指定输出格式
      • 按名称分组统计进程
      • 查看特定进程组(通配符支持)
      • 关闭特定进程
        • by Name
      • ps&kill(stop)
      • 当前用户启动的进程(管理员)
    • Microsoft 为windows 提供的辅助工具集合:Sysinternals
      • 进程管理/监视扩展工具
    • 第三方开源命令行进程工具
  • windows_powershell/cmd_移除服务(remove service)/移除mysql服务
    • references
    • powershell方式
      • powershell_查找服务/检查服务状态
      • 停止服务
      • powershell 删除服务
        • 管理员模式下删除指定服务
    • sc(老式方法)
      • sc.exe 位置
      • Syntax
      • Examples

powershell_进程任务管理/服务管理/(查看/关闭/停止/移除&windows移除mysql服务

references

  • PowerShell Get-Process | Parameters in PowerShell Get-Process (educba.com)

获取软件版本

  • 根据进程名称获取软件版本
  • ps -FileVersionInfo -Name *edge*

指定输出格式

  • Format-Table - PowerShell - SS64.com

按名称分组统计进程

  • ps |group ProcessName |sort Name

  • PS C:\Users\cxxu> ps |group ProcessName |Sort Name                  Count Name                      Group
    ----- ----                      -----1 aix-node                  {System.Diagnostics.Process (aix-node)}6 Apifox                    {System.Diagnostics.Process (Apifox), System.Diagnostics.…1 audiodg                   {System.Diagnostics.Process (audiodg)}1 backgroundTaskHost        {System.Diagnostics.Process (backgroundTaskHost)}1 ChsIME                    {System.Diagnostics.Process (ChsIME)}4 Clash for Windows         {System.Diagnostics.Process (Clash for Windows), System.D…1 cla-core-service        {System.Diagnostics.Process (cla-core-service)}1 cla-win64               {System.Diagnostics.Process (cla-win64)}16 Code                      {System.Diagnostics.Process (Code), System.Diagnostics.Pr…14 conhost                   {System.Diagnostics.Process (conhost), System.Diagnostics…1 copilot-agent-win         {System.Diagnostics.Process (copilot-agent-win)}2 csrss                     {System.Diagnostics.Process (csrss), System.Diagnostics.P….....1 IntelCpHDCPSvc            {System.Diagnostics.Process (IntelCpHDCPSvc)}1 IntelCpHeciSvc            {System.Diagnostics.Process (IntelCpHeciSvc)}1 jhi_service               {System.Diagnostics.Process (jhi_service)}1 KwService                 {System.Diagnostics.Process (KwService)}1 WmiPrvSE                  {System.Diagnostics.Process (WmiPrvSE)}2 WUDFHost                  {System.Diagnostics.Process (WUDFHost), System.Diagnostic…1 ZhuDongFangYu             {System.Diagnostics.Process (ZhuDongFangYu)}
    

查看特定进程组(通配符支持)


PS C:\Users\cxxu> ps *wechat*|group ProcessName |ft -wrapCount Name                      Group
1 WeChat                    {System.Diagnostics.Process (WeChat)}
2 WeChatAppEx               {System.Diagnostics.Process (WeChatAppEx), System.Diagnostics.Process (WeChatAppEx)}
6 WechatBrowser             {System.Diagnostics.Process (WechatBrowser), System.Diagnostics.Process (WechatBrowser), System.Diagnostics.Process (WechatBrowser), System.Diagnostics.Process (WechatBrowser)…}
1 WeChatPlayer              {System.Diagnostics.Process (WeChatPlayer)}

关闭特定进程

by Name

  • 先借助ps命令查找到相关进程信息

    • id
    • processName
PS C:\Users\cxxu> ps idm*NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName------    -----      -----     ------      --  -- -----------37    12.58      16.67     114.84    9980   3 IDManPS C:\Users\cxxu> stop -Name IDMan

ps&kill(stop)

  • ps *photo*|kill 杀死photo进程

当前用户启动的进程(管理员)

  • 注意启动管理员模式才可以使用IncludeUserName
  • Get Process Name and Owner User Name (thinkpowershell.com)

    • PS C:\Users\cxxu> $who="$(whoami)";Get-Process  -IncludeUserName|where{$_.UserName -like $who }WS(M)   CPU(s)      Id UserName                       ProcessName-----   ------      -- --------                       -----------4.46     5.53    9660 CXXUWIN11\cxxu                 ApplicationFrameHost0.00     0.58    4092 CXXUWIN11\cxxu                 backgroundTaskHost0.00     0.08    9056 CXXUWIN11\cxxu                 ChsIME5.61     4.80    8868 CXXUWIN11\cxxu                 Clash for Windows
      

    • PS C:\Users\cxxu> $who="$(whoami)";Get-Process  -IncludeUserName|where{$_.UserName -like $who } |group ProcessName |sort NameCount Name                      Group
      ----- ----                      -----1 ApplicationFrameHost      {System.Diagnostics.Process (ApplicationFrameHost)}1 backgroundTaskHost        {System.Diagnostics.Process (backgroundTaskHost)}1 ChsIME                    {System.Diagnostics.Process (ChsIME)}4 Clash for Windows         {System.Diagnostics.Process (Clash for Windows), System.D…15 Code                      {System.Diagnostics.Process (Code), System.Diagnostics.Pr…6 conhost                   {System.Diagnostics.Process (conhost), System.Diagnostics…1 ctfmon                    {System.Diagnostics.Process (ctfmon)}
      

Microsoft 为windows 提供的辅助工具集合:Sysinternals

  • Sysinternals - Windows Sysinternals | Microsoft Docs

进程管理/监视扩展工具

  • PsList - Windows Sysinternals | Microsoft Docs

第三方开源命令行进程工具

跨平台:

  • btm(bottom)
  • procs

其他:

  • ntop(for windows)
  • htop (for linux)

windows_powershell/cmd_移除服务(remove service)/移除mysql服务

references

  • sc.exe delete | Microsoft Docs
  • Remove-Service (Microsoft.PowerShell.Management) - PowerShell | Microsoft Docs

powershell方式

powershell_查找服务/检查服务状态

  • 查找服务(以mysql为例)
PS C:\Users\cxxu> gsv *mysql*Status   Name               DisplayName
Stopped  MySQL              MySQL

停止服务

  • stop-service
NAMEStop-ServiceSYNOPSISStops one or more running services.

powershell 删除服务

管理员模式下删除指定服务

  • remove-service命令

非管理员模式下删除:

Remove-Service: Failed to configure the service ‘mysql (MySQL)’ due to the following error: Access is denied… Run PowerShell as admin and run your command again.

PS C:\Users\cxxu> remove-service -Name mysql#执行顺利,没有返回消息

sc(老式方法)

  • 可以在cmd 环境下运行

sc.exe 位置

PS C:\Users\cxxu> where.exe sc
C:\Windows\System32\sc.exe

Syntax

sc.exe [<servername>] delete [<servicename>]

Examples

To delete the service subkey NewServ from the registry on the local computer, type:

Copy

sc.exe delete NewServ
DESCRIPTION:SC is a command line program used for communicating with theService Control Manager and services.
USAGE:sc <server> [command] [service name] <option1> <option2>...The option <server> has the form "\\ServerName"Further help on commands can be obtained by typing: "sc [command]"Commands:query-----------Queries the status for a service, orenumerates the status for types of services.queryex---------Queries the extended status for a service, orenumerates the status for types of services.start-----------Starts a service.pause-----------Sends a PAUSE control request to a service.interrogate-----Sends an INTERROGATE control request to a service.continue--------Sends a CONTINUE control request to a service.stop------------Sends a STOP request to a service.config----------Changes the configuration of a service (persistent).description-----Changes the description of a service.failure---------Changes the actions taken by a service upon failure.failureflag-----Changes the failure actions flag of a service.sidtype---------Changes the service SID type of a service.privs-----------Changes the required privileges of a service.managedaccount--Changes the service to mark the service account password as managed by LSA.qc--------------Queries the configuration information for a service.qdescription----Queries the description for a service.qfailure--------Queries the actions taken by a service upon failure.qfailureflag----Queries the failure actions flag of a service.qsidtype--------Queries the service SID type of a service.qprivs----------Queries the required privileges of a service.qtriggerinfo----Queries the trigger parameters of a service.qpreferrednode--Queries the preferred NUMA node of a service.qmanagedaccount-Queries whether a services uses an account with a password managed by LSA.qprotection-----Queries the process protection level of a service.quserservice----Queries for a local instance of a user service template.delete----------Deletes a service (from the registry).create----------Creates a service. (adds it to the registry).control---------Sends a control to a service.sdshow----------Displays a service's security descriptor.sdset-----------Sets a service's security descriptor.showsid---------Displays the service SID string corresponding to an arbitrary name.triggerinfo-----Configures the trigger parameters of a service.preferrednode---Sets the preferred NUMA node of a service.GetDisplayName--Gets the DisplayName for a service.GetKeyName------Gets the ServiceKeyName for a service.EnumDepend------Enumerates Service Dependencies.The following commands don't require a service name:sc <server> <command> <option>boot------------(ok | bad) Indicates whether the last boot shouldbe saved as the last-known-good boot configurationLock------------Locks the Service DatabaseQueryLock-------Queries the LockStatus for the SCManager Database
EXAMPLE:sc start MyServiceQUERY and QUERYEX OPTIONS:If the query command is followed by a service name, the statusfor that service is returned.  Further options do not apply inthis case.  If the query command is followed by nothing or one ofthe options listed below, the services are enumerated.type=    Type of services to enumerate (driver, service, userservice, all)(default = service)state=   State of services to enumerate (inactive, all)(default = active)bufsize= The size (in bytes) of the enumeration buffer(default = 4096)ri=      The resume index number at which to begin the enumeration(default = 0)group=   Service group to enumerate(default = all groups)SYNTAX EXAMPLES
sc query                - Enumerates status for active services & drivers
sc query eventlog       - Displays status for the eventlog service
sc queryex eventlog     - Displays extended status for the eventlog service
sc query type= driver   - Enumerates only active drivers
sc query type= service  - Enumerates only Win32 services
sc query state= all     - Enumerates all services & drivers
sc query bufsize= 50    - Enumerates with a 50 byte buffer
sc query ri= 14         - Enumerates with resume index = 14
sc queryex group= ""    - Enumerates active services not in a group
sc query type= interact - Enumerates all interactive services
sc query type= driver group= NDIS     - Enumerates all NDIS drivers

powershell_windows命令行杀进程(pskill)/进程任务管理/服务管理/(查看/关闭/停止/移除windows移除mysql服务)相关推荐

  1. Linux命令行下杀死一个进程

    在做项目的时候经常会出现程序死机.锁死.无响应等情况,这时候就需要找到程序相应的进程将其杀掉即可.步骤如下: 1.定位进程 top命令:可以实时动态地查看系统的整体运行情况,是一个综合了多方信息监测系 ...

  2. 如何避免 Go 命令行执行产生“孤儿”进程?

    简介: 在 Go 程序当中,如果我们要执行命令时,通常会使用 exec.Command ,也比较好用,通常状况下,可以达到我们的目的,如果我们逻辑当中,需要终止这个进程,则可以快速使用 cmd.Pro ...

  3. qt命令行程序启动外部进程_QT之程序打包发布

    1.引言 QT开发完之后,如果直接把exe文件发给别人,是没法直接用的,因为会提示缺少很多库,一种方法是把这些库拷贝出来,一起发过去,但是这样不方便且文件很大,所以需要一种文件打包发布的方法. 2.环 ...

  4. linux命令行杀毒工具,Linux下杀毒软件Clamav的安装和使用

    操作系统版本信息 CentOS Linux release 7.4.1708 (Core) ClamAV 简单介绍 ClamAV 杀毒是Linux平台最受欢迎的杀毒软件,ClamAV属于免费开源产品, ...

  5. windows下启动mysql服务的命令行启动和手动启动方法

    一: 手动启动 选择计算机(我的电脑)右击鼠标,选择管理,在选择系统和应用服务下面的服务. 找到MySQL,右击选择启动或停止.如图: 二: 命令行下启动mysql服务. (1)先找到mysql的安装 ...

  6. Windows中使用命令行杀进程

    使用命令杀进程的几种方式: 1,根据进程名称杀进程:taskkill /f /t /im qq.exe  //此例是杀QQ进程 2,通过进程号杀进程 :taskkill /pid 9396 -f    ...

  7. win7命令行 端口占用 查询进程号 杀进程

    打开CMD窗口 win+R–>cmd 根据端口号查找进程号 netstat -nao|grep 端口号 根据进程号得到进程名 tasklist |findstr 进程号 杀进程 taskkill ...

  8. linux一个命令行找到并杀死进程

    不废话,上代码,比如进程名称是s01.py ps -ef | grep s01.py | awk '{print $2}' | xargs kill -9

  9. linux命令行安装ifconfig,CentOS 7安装 ifconfig 管理命令

    1. 安装的需求背景 我们知道ifconfig 命令可以用于查看.配置.启用或禁用指定网络接口,如配置网卡的IP地址.掩码.广播地址.网关等,功能不可谓不丰富. 此命令的功能和Wndows系统的ipc ...

  10. windows无法启动MySQL服务(位于本地计算机上)。错误1067:进程意外终止

    由于mysql数据库文件有点大,备份时空间不是很够,备份完了数据库因为磁盘空间不够服务挂了.重启时出现以下错误: 重启计算机后仍然报同样错误: 直接搜索这个报错五花八门,各种骚操作,感觉没有一个是稳的 ...

最新文章

  1. softmax 与 logsoftmax 区别 或者说logsoftmax优点
  2. JavaScript中call()和apply()的用法及区别
  3. 信息系统项目管理师-项目集、项目组合管理考点笔记
  4. 【Java每日一题】20161219
  5. BZOJ_1009_[HNOI2008]_GT考试_(动态规划+kmp+矩阵乘法优化+快速幂)
  6. php打印mysql sql_php的打印sql语句的方法
  7. Linux socket多进程服务器框架二
  8. TensorFlow 入门 | iBooker·ApacheCN
  9. Serverless 是一种思想状态
  10. 如何使柱状图左右展示_关于微生物门类堆叠柱状图,你知道的并不够
  11. C++类引用中的构造函数与析构函数的执行顺序练习
  12. Hadoop原理之——HDFS原理
  13. 基于微信小程序的毕业设计题目(27)php校园跑腿小程序(含开题报告、任务书、中期报告、答辩PPT、论文模板)
  14. matlab直方图匹配,直方图匹配 histogram match
  15. 戴尔通过F12一次性引导菜单刷新BIOS
  16. 猿创征文|【实用工具tcping】ping tcping的区别,使用命令,超全超详细使用手册(建议收藏)
  17. win7的ie10浏览器打不开,就是双击图标无反应
  18. 同一个ssh key用在多台电脑上
  19. 设置webhook_数据采集教程_智能模式_如何设置Webhook功能_后羿采集器
  20. 分类:朴素贝叶斯分类方法

热门文章

  1. 基于python的图片比较
  2. java正则匹配以什么开始的_正则匹配 符合以什么开头以什么结尾的
  3. 本经阴符七术--鬼谷子
  4. Flink部署——Debugging(开发实用,建议收藏)
  5. 计算机关机界面设置在哪里,电脑怎么设置关机画面
  6. 标准88 钢琴键代码 html+css+js
  7. 浅谈Linux PMIC驱动(一)
  8. ERROR: operator does not exist: integer = character varying
  9. Class -- 07 -- Modifier类常用方法解析
  10. libvirt live migration 流程