Dir - list of all folders except some

I am trying to make a Windows batch file to show the installed Half Life 1 mods.

Installed mods have their own folder in the hl.exe directory, for example cstrike

or SvenCoop


But there are also a few folders in the same directory that are part of hl1 engine: bin

, gldrv

, platform

, relists

and valve


I would like to do dir

that lists all the folders in that directory except those 5 folders that are part of the hl1 engine.


source to share

1 answer

@echo off
setlocal EnableDelayedExpansion
for /D %%d in (*) do (
    set show=yes
    for %%a in (bin gldrv platform relists valve) do if %%d == %%a set show=no
    if !show! == yes dir %%d




All Articles