How to search for .ini .bat files in the Windows folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
dimitree#_#
Posts: 1
Joined: 09 Jan 2022 10:40

How to search for .ini .bat files in the Windows folder

#1 Post by dimitree#_# » 09 Jan 2022 10:57

Hi community,
I need to write a batch file which shows me all .ini .bat and .txt files in the c:\windows folder side by side. After every file found I need a PAUSE before the next file is searched.
I am kinda lost and I dont have any idea how to do that. Do I need to use the DIR or SET cmd?

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How to search for .ini .bat files in the Windows folder

#2 Post by aGerman » 10 Jan 2022 11:24

Untested:

Code: Select all

@echo off &setlocal
pushd "C:\Windows"
for /f "delims=" %%i in ('dir /a-d /b /s *.ini *.bat *.txt') do echo "%%~i"&pause
popd
Something about like that.

Steffen

Jedininja
Posts: 25
Joined: 11 Jan 2022 22:41
Location: CanafukpilesDa
Contact:

Re: How to search for .ini .bat files in the Windows folder

#3 Post by Jedininja » 11 Jan 2022 23:04

Code: Select all

 find "*.ini" %windir%  

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How to search for .ini .bat files in the Windows folder

#4 Post by aGerman » 13 Jan 2022 13:25

And what is about
After every file found I need a PAUSE before the next file is searched.
Steffen

Jedininja
Posts: 25
Joined: 11 Jan 2022 22:41
Location: CanafukpilesDa
Contact:

Re: How to search for .ini .bat files in the Windows folder

#5 Post by Jedininja » 13 Jan 2022 21:26

dimitree#_# wrote:
09 Jan 2022 10:57
Hi community,
I need to write a batch file which shows me all .ini .bat and .txt files in the c:\windows folder side by side. After every file found I need a PAUSE before the next file is searched.
I am kinda lost and I dont have any idea how to do that. Do I need to use the DIR or SET cmd?
I get an access ddenied error when i run the "find" command but i have used this line many times before!
:start
find /i "*.ini" %windir%
pause
goto :start

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: How to search for .ini .bat files in the Windows folder

#6 Post by aGerman » 14 Jan 2022 11:29

You didn't even try your code, did you?

Steffen

Post Reply