Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
@echo off
for /f "delims=" %%a in ('Tasklist /fi "Imagename eq svchost.exe"') do set/a a+=1&echo.%%a
set/a a-=2
echo.Total %a% svchost.exe&pause@echo off
for /f %%a in ('Tasklist /nh /fi "Imagename eq svchost.exe"') do set/a a+=1
echo.Total %a% svchost.exe&pauseOr: @echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in ('Tasklist /svc /fi "Imagename eq svchost.exe"') do echo.%%a&set a=%%a&if not "!a:~0,1!"==" " set/a n+=1
set/a n-=2
echo.Total %n% svchost.exe&pauseOr: @echo off&setlocal enabledelayedexpansion
for /f "delims=" %%a in ('Tasklist /m /fi "Imagename eq svchost.exe"') do echo.%%a&set a=%%a&if not "!a:~0,1!"==" " set/a n+=1
set/a n-=2
echo.Total %n% svchost.exe&pauseOriginally posted by xue0808 at 2010-5-17 16:12:
set/a n-=2
Why add this???