Page 1 of 1

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

Posted: 09 Jan 2022 10:57
by dimitree#_#
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?

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

Posted: 10 Jan 2022 11:24
by aGerman
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

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

Posted: 11 Jan 2022 23:04
by Jedininja

Code: Select all

 find "*.ini" %windir%  

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

Posted: 13 Jan 2022 13:25
by aGerman
And what is about
After every file found I need a PAUSE before the next file is searched.
Steffen

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

Posted: 13 Jan 2022 21:26
by Jedininja
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

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

Posted: 14 Jan 2022 11:29
by aGerman
You didn't even try your code, did you?

Steffen