Write a batch program called EX4.BAT
which lists all files matching any of the following criteria within the root of the C:
drive and down through its subdirectories:
a) Files with an extension of .COM
and have 4 letters in the filename. e.g. chcp.com
, mode.com
etc.
b) .EXE
files whose 2nd letter is I
e.g., WINHELP.EXE
DIAGS.EXE
etc.
Make sure the output does not scroll up the screen too quickly.
Put a pause
command in between parts a) and b)
I tried the following :
cd\ Rem to return to the root folder of C
dir ????.com /b/s Rem COM files with 4 letters
pause Rem to pause the screen
dir ?I*.exe /s Rem search EXE files whose 2nd letter is I
For part a), doing this like that accept also numbers, I have to make sure that it accepts only letters. I tried to make use of regular expression but in vain.