Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Batch Programmierung FOR Schleife

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe ein Batch-Script geschrieben, welches ich um eine Funktion erweitern möchte, aber ich bekomme das leider nicht hin. Hier erst mal die lauffähige Version.

@echo off

set Filter=*.jpl

set Ordner=D:\Validierung\Error\black

set /A DateiAnzahl=0

set Status=3

set Statustext=UNKNOWN


for /R %Ordner% %%f in (%Filter%) do (

	set /A DateiAnzahl += 1

)


if %DateiAnzahl% geq 20 (

	set Status=2

	set Statustext=CRITICAL

	goto Ausgabe

)


if %DateiAnzahl% geq 1 (

	set Status=1

	set Statustext=WARNING

	goto Ausgabe

)


if %DateiAnzahl% == 0 (

	set Status=0

	set Statustext=OK

        goto Ausgabe

)


:Ausgabe

echo %Status% Filecount_%Ordner% count=%DateiAnzahl%;1;20;0; %Statustext% - %DateiAnzahl% file(s) in %Ordner%

Nun möchte ich das Script so erweitern, dass ich nicht nur einen Ordner sondern mehrere überprüfen kann. Dabei ist zu beachten, dass unten die Echo-Ausgabe für jeden Ordner separat aufgerufen werden soll. Bei drei Ordnern also drei Ausgaben.

Theoretisch müsste ich mein Script in eine weitere For-Schleife packen und entsprechend oft durchlaufen. Ich habe da schon rum probiert, aber ich bekomme das von der Syntax nicht hin.

Könnt ihr mir da helfen?

Ja danke - damit kann ich was anfangen.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.