Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

create batch file to file search

how would i make a batch file to do a file search?
this looks like it is somewhere along the lines.
Code
@echo OFF

for /f %%F in ('dir %2\%1 /s /b') do (
    <nul (set /p msg=%%~nxF )
    for /f %%G in ('dir %3\%%~nxF /s /b') do (
        if exist %%G (
            @echo found at %%G
        )
    )
)
%1 is the user provided file mask.

%2 is the user provided directory to search first.

%3 is the user provided directory to search second.

Call from the command line to generate a report:
FindAll *.dll d:\dir1 d:\dir2 > dll_report.txt 2

reference:
http://stackoverflow.com/questions/41471...-for-files
[Image: 2e242a71137efe1090374973c5a987cf.png]
@vaxo Hi i have just tested it and its just a blank screenand i can type anything or do anything with it.
Hi 🤝

You can try something like that :

PHP Code

<?php 
@echo off
Title Searching files by Hackoo 2016
Mode con cols
=90 lines=3
cls 
& color 9E
echo(
Set /p "Location=Enter the folder location where do you want to serach> "
cls & echo(
echo 
You chose this location "%Location%"
echo(
Set /p "FileName=Enter the file name to looking for> "
Set Tmp=Tmp.txt
Set SearchResult
=SearchResult.txt
echo( & cls
echo(  & echo     Please Wait for moment .... Searching for "%FileName%" on "%Location%"
where /r "%Location%" "%FileName%" > %Tmp%
Cmd /U /C Type %Tmp% > %SearchResult%
Del %Tmp%
Start %SearchResult% 
Hi hackoo can you make it list the file instead of making it write a txt like i would like it to say all files found called "anything" then a list of them and would you view delete the files and then have an option of a few of them or all files under the name "anything"


i am trying to make a file search and delete tool


I would like to make a file search and delete tool and i would like the location to be everywhere like search the whole computer
Also, creating over 3 threads about the same question is frowned upon.
(Apr 30, 2016 07:37 PM)Hackoo Wrote:  snip

I was unaware of the "where" command! Very interesting sir!
(Apr 30, 2016 08:08 PM)missNasser Wrote:  Hi hackoo can you make it list the file instead of making it write a txt like i would like it to say all files found called "anything" then a list of them and would you view delete the files and then have an option of a few of them or all files under the name "anything"


i am trying to make a file search and delete tool


I would like to make a file search and delete tool and i would like the location to be everywhere like search the whole computer

Well, yes, it's possible, but please try to do that little thing by yourself.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Shell] by Robert RougeSep 24, 2026 10:02 AM 4 219 Sep 24, 2026 10:02 AM
Last Post: Anonynuk
[Shell] by fisica638Oct 30, 2019 11:05 AM 1 536 Oct 30, 2019 11:05 AM
Last Post: Hackoo
[C] by Tr0jandogOct 11, 2019 08:32 PM 1 204 Oct 11, 2019 08:32 PM
Last Post: stderr