@echo off
setlocal enabledelayedexpansion
echo 获取服务显示名
echo.
echo 作者:phenix
echo.
echo 邮箱:279682817@qq.com
echo.
tasklist /svc /fo list|more
set /p pid=请输入PID号:
echo.
for /f "skip=1 tokens=*" %%1 in ('tasklist /svc /fo csv /fi "pid eq !pid!"') do (
set row=%%1
set row=!row:","=;!
set row=!row:"=!
for /f "tokens=1,2,3 delims=;" %%a in ("!row!") do (
set name=%%c
echo PID为!pid!的信息如下:
echo.
echo 任务信息:
echo.
echo 映像名称 PID 服务
echo.
echo %%a %%b %%c
echo.
echo 服务信息:
echo.
set name=!name:,=^&sc getdisplayname !
for /f "tokens=*" %%a in ('sc getdisplayname !name!') do (
set dname=%%a
set dname=!dname:名称=!
set dname=!dname:~1!
set sign=!dname:~0,1!
if "!sign!" equ "=" (
echo !dname:~2!
)
)
)
)
pause
exit
批量获取windows10进程服务信息
最新推荐文章于 2022-11-22 23:16:58 发布