Formatieren einer Ausgabe mit Variablen
Wie kann ich ein "ECHO %Variable1:~Var2,VAR3%" umsetzen?
Hallo,
ich versuche gerade eine Variable auszugeben bei der vorn und hinten jeweils etwas abgeschnitten wird.
Das Programm könnte auten:
Und die Ausgabe sollte dann nur "13" sein.
Jemand ne Idee?
ich versuche gerade eine Variable auszugeben bei der vorn und hinten jeweils etwas abgeschnitten wird.
Das Programm könnte auten:
@ECHO OFF & setlocal EnableDelayedExpansion
SET Var1 = "Antwort von 193.99.144.80: Bytes=32 Zeit=13ms TTL=246"
SET Var2 = 41
SET Var3 = 10
REM Ausgeführt werden soll im Bsp. ECHO %Var1:~41,-10%
ECHO %Var1:~Var2,-VAR3%
Jemand ne Idee?
Please also mark the comments that contributed to the solution of the article
Content-Key: 128091
Url: https://administrator.de/contentid/128091
Printed on: April 19, 2024 at 12:04 o'clock
5 Comments
Latest comment