to dir or not to dir

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
BABUT
Posts: 1
Joined: 06 Jan 2024 02:01

to dir or not to dir

#1 Post by BABUT » 06 Jan 2024 02:11

Code: Select all

set Dir?=for /l %%# in (1 1 2) do if %%#==2 (for /f "tokens=*" %%# in (!in!) do if not "%%~a#"=="d----------" color 11) else setlocal enabledelayedexpansion ^& set in=
example:

Code: Select all

%Dir?%"c:\windows"
if %errorlevel%==0 (echo dir) else (echo file)
it works through symbolic links(everything you can google doesn't work)

miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Re: to dir or not to dir

#2 Post by miskox » 06 Jan 2024 13:26

2B OR NOT 2B=FF

Saso

Post Reply