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.

CMD Ausgabe in eine Variable schreiben und String kürzen?

Empfohlene Antworten

Hallo Leute ich hab eine Frage zu Batch Dateien da ich in dem Gebiet noch komplett neu bin :rolleyes:

ich hab den Befehl snmpget -v1 -c public 192.168.50.207 .1.3.6.1.4.1.2699.1.1.1.1.1.1.7.1

der mir SNMPv2-SMI::enterprises.2699.1.1.1.1.1.1.7.1 = STRING: "FS-C5025N" zurück gibt.

Wie kann ich nun diese Ausgabe in eine Variable in meiner Batch Datei bringen?

ich bräuchte das Ganze aber noch auf FS-C5025N gekürzt

ist das irgendwie möglich?

Vielen Dank schonmal

homecomingservice

Hatte es in der Seiten down phase selbst gelöst hier das ergebnis :D

@echo off &setlocal

for /f "delims=" %%a in ('snmpget -v1 -c public ***.***.***.***..1.3.6.1.4.1.2699.1.1.1.1.1.1.7.1') do (

  echo ganze Zeile:%%a

  set "x=%%a"

  setlocal enabledelayedexpansion

  set "x=!x:"=#!"

  echo ersetzte Zeichenfolge:!x!

  for /f "tokens=2 delims=#" %%b in ("!x!") do (

    endlocal

    echo String:%%b

    set "string=%%b"

  )

)


 echo %modell%

 pause

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

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.