Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

cmd echo all, except lines that contains. (whitelist software that is ok, but output non-whitelisted)

Avatar of urfried
urfriedFlag for Netherlands asked on
Microsoft DOS
4 Comments1 Solution552 ViewsLast Modified:
Ola gents,

We created some batch to find all installed programs on workstations.
we would like to filter out a whitelist, and echo the non-whitelisted.

For instance....Filter out all software that contains:
enz. enz.

And echo the software that isn't whitelisted.

All help is appreciated.
Thanx in advance.

setlocal enabledelayedexpansion

for /f "tokens=*" %%i in ('reg query HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall /s ^|findstr /R "\<DisplayName"') do (
                                   set /a cl+=1
                                   set softw_!cl!=%%i
for /l %%i in (1, 1, %cl%) do      (
			        set softw_%%i=!softw_%%i:~19!
			        echo !softw_%%i!