Computing.Net > Forums > Programming > Batch File - For

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch File - For

Reply to Message Icon

Name: shahramsh
Date: June 16, 2006 at 13:00:00 Pacific
OS: win xp pro
CPU/Ram: P4/1G
Product: asus
Comment:

This is to show the processes other than the ones in the list

====================
@echo off
set progl=smss.exe,csrss.exe,winlogon.exe,services.exe,lsass.exe,svchost.exe,spoolsv.exe,alg.exe,dllhost.exe
FOR /F %%a in ('tasklist /NH') do FOR %%b in (%progl%) do if "%%a" NEQ "%%b" echo %%a
====================

Does anybody know anyways (possibly easy syntax) to make this work?

(I know the problem, but can't find an easy solution)



Sponsored Link
Ads by Google

Response Number 1
Name: shahramsh
Date: June 16, 2006 at 14:26:02 Pacific
Reply:

Figured it out,
hopefully working,

=================
@echo off
set progl=smss.exe,csrss.exe,winlogon.exe,services.exe,lsass.exe,svchost.exe,spoolsv.exe,alg.exe,dllhost.exe

FOR /F %%a in ('tasklist /NH') do call :show %%a
:show
set o=n
FOR %%b in (%progl%) do if "%1"=="%%b" set o=y
if "%o%" == "n" if "%1" NEQ "" echo %1
==================


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch File - For

Batch file for Outlook www.computing.net/answers/programming/batch-file-for-outlook/15439.html

Batch file input for logevent.exe www.computing.net/answers/programming/batch-file-input-for-logeventexe/15380.html

Batch file FOR LOOP www.computing.net/answers/programming/batch-file-for-loop/11504.html