i need some help with my batch file.
I need a batch file that is searching recursiv for a special file.
The file which im am searching for looks like "*.txt".
If one text file was found in the folder the foldername should be renamed to "foldername [filename]".
for example:
folder 1\folder 2\file1.txt
the batch file finds the "file1.txt" in folder 1\folder 2 and renams the folder "folder 2" into "folder 2 [file1]".
This is my script so far.
Code: Select all
@echo off
title Videosammlung Audiobearbeitung
Color 2F
REM Eingabe der Dateiendung die gesucht wird.
SET /P Dateiendung=Zu suchende Dateiendung eingeben:
SET DATEI=*.%Dateiendung%
REM Rekursive Suche nach der Datei mit der eingegebenen Dateiendung und schreiben in ein Log-File.
DIR /b /s %datei% > log.txt
PAUSE
I thought i could create a log-File and search in this log-File to get my result. But i am stuck.
Can anybody help.
Many thanks!
Shawn26