-
Notifications
You must be signed in to change notification settings - Fork 0
/
DelAllV2.cmd
41 lines (36 loc) · 914 Bytes
/
DelAllV2.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@echo off
REM --------------------------------------------------------------------------
REM | Skript zum leeren der Ordnerstruktur unterhalb des in der Variablen |
REM | %ALLGEMEIN% angegebenen Verzeichnisses. Nach dem Löschen wird die erste |
REM | Kindebene unterhalb des Verzeichnisses wieder hergestellt. |
REM --------------------------------------------------------------------------
setlocal enabledelayedexpansion
set ALLGEMEIN="c:\temp\Allgemein\"
pushd %ALLGEMEIN%
:READ
echo suche Ordner...
set LIST=
for /d %%d in (*) do (
echo '%%d' gefunden
set LIST=!LIST! %%d
)
set /P R_U_SURE="Jetzt leeren (J/N)?"
if /I "%R_U_SURE%" NEQ "J" GOTO END
:DELETE
echo.
echo leeren...
for /d %%d in (%LIST%) do (
echo entferne '%%d'
rd /s /q %%d
)
:REBUILD
echo.
echo Struktur neu aufbauen...
for /d %%d in (%LIST%) do (
echo erstelle '%%d'
md %%d
)
:END
popd
endlocal
@echo on