Batch soll festgelegte Anzahl von Dateien im Verzeichnis ermitteln
Hallo,
ich benötige für ein Backup-Copyjob ein Batch-Skript das im Verzeichnis "Backup" die Anzahl der Dateien zählt und bei genau 15 Dateien das Skript weiter ausführt.
Ungefähr so:
IF Anzahl Dateien in C:\Backup = 15
THEN goto
ELSE goto
Danke und Gruß
Don
ich benötige für ein Backup-Copyjob ein Batch-Skript das im Verzeichnis "Backup" die Anzahl der Dateien zählt und bei genau 15 Dateien das Skript weiter ausführt.
Ungefähr so:
IF Anzahl Dateien in C:\Backup = 15
THEN goto
ELSE goto
Danke und Gruß
Don
Please also mark the comments that contributed to the solution of the article
Content-Key: 72661128918
Url: https://administrator.de/contentid/72661128918
Printed on: May 23, 2024 at 18:05 o'clock
2 Comments
Latest comment
Unsere Suchfunktion schon wieder kaputt?
Sid.
@echo off &setlocal
set cnt=0
for /f "delims=" %%a in ('dir /b /a-d "d:\Backup" 2^>nul') do set /a cnt+=1
if %cnt% == 15 (
echo 15 files da
) else (
echo whatever
)