
Zitat von
pythonfreak
Code:
FOR /f "delims=" %%G in (folders.txt) DO RMDIR /s /q "%%G"
Danke aber ist denke nicht das was suche.
Nochmal als erklärung.
In der TXT steht:
Code:
A.Chivalry.of.a.Failed.Knight
Accel.World
Akatsuki.no.Yona
Aldnoah.Zero
Appleseed.XIII
Arpeggio.of.Blue.Steel
Assassination.Classroom
Atelier.Escha.und.Logy
Attack.on.Titan
Ghost.in.the.Shell
Gintama
God.Eater
Guardian.of.the.Spirit
Guilty.Crown
...
(ist abgekürzt)
Nun soll die .bat im Pfad C:/Test/ die Ordner löschen wie es in der .txt steht.
Also wird zb. der Ordner "C:/Test/Accel.World" gelöscht, wenn dieser existiert.
alle anderen ordnernamen die nicht in der .txt stehen sollen natürlich erhalten bleiben.

Zitat von
udg
Code:
@ECHO OFF
Set dir=test
echo.
Echo Setting: "%dir%" as Directory within the Folder that you want to delete
echo -----------------------------------------------------------------------
::now delete your specified Folders
@del %dir%\aaa /F /Q
@del %dir%\bbb /F /Q
@del %dir%\ddd /F /Q
echo.
echo.
Echo Deleting all folders from: "%dir%" except CCC.
echo.
echo.
echo.
::and flush 'em
for /d %%p in (%dir%\aaa) Do rd /Q /S "%%p"
for /d %%p in (%dir%\bbb) Do rd /Q /S "%%p"
for /d %%p in (%dir%\ddd) Do rd /Q /S "%%p"
echo -----------------------------------------------------------------------
echo.
echo.
@echo All specified Folder deleted except CCC.
echo.
echo.
echo -----------------------------------------------------------------------
pause
Example:
Zippyshare.com - BatchExample_withFolders.rar
danke udg. geht das auch mit dem auslesen aus der .txt file?