windows 运维工具

wmic

此工具有很多功能

查看进程的运行参数

wmic process where caption="chrome.exe"

wmic process where(description="mysqld.exe") >> mysql.log
#查询MySQL的路径输出到MySQL.log文件
 
wmic process where(description="cmd.exe")
#查询cmd的路径并立即输出
 
wmic service where caption="zhudongfangyu" call stopservice  
wmic service where name="zhudongfangyu" call stopservice
echo y|wmic process where processid=6428 call terminate  干掉pid
echo y|wmic process where name="SogouExplorer.exe" call terminate 干掉进程
 
wmic process get description,executablepath
#获取进程路径
 
wmic product get name,versionwmic product list brief
#查看安装的软件
 

查看CPU信息

wmic cpu get

NumberOfCores:表示CPU核心数

NumberOfLogicalProcessors:表示CPU逻辑核数。当有超线程时,比如2,逻辑核数=核心数*2

使用 systeminfo 也可查看

服务运行winsw

https://github.com/kohsuke/winsw

示例配置:

<?xml version="1.0" encoding="UTF-8"?>

<service>

    <id>Nginx</id>

    <name>Nginx</name>

    <description>nginx</description>

    <logpath>D:\nginx\logs</logpath>

    <executable>nginx.exe</executable>

    <stopexecutable>nginx.exe</stopexecutable>

    <stopargument>-s</stopargument>

    <stopargument>stop</stopargument>

    <logmode>rotate</logmode>

</service>

脚本:设置ip与连接wifi

netsh interface ipv4 set address name="无线网络连接" source=static addr=192.168.108.165 mask=255.255.255.0 gateway=192.168.108.1
netsh wlan connect ssid=langchao_1 name=langchao_1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值