Wert aus TXT Datei auslesen via Batch
Ich trete auf der Stelle.
Ich muss einen Reg Wert aus lesen und weiter verarbeiten.
Windows Server 64 BIT kein Problem alles fertig.
Nur für die Clients Windows XP komme ich nicht weiter.
Ich brauche den Wert:"HKEY_LOCAL_MACHINE\SOFTWARE\Testsoftware\Rocker" und dann den Schlüssel "installation_directory"
Also ich:
Ergebnis:
Den Dateipfad hinterm dem REG_SZ muss ich haben zur Weiterverarbeitung.
Ich hatte mir vorgestellt dass ich das mit einer FOR Anweisung hin bekomme in etwa so:
Aber Pustekuchen! VBS/C+ etc. darf ich nich.
Kann mir da jemand helfen?
Windows Server 64 BIT kein Problem alles fertig.
Nur für die Clients Windows XP komme ich nicht weiter.
Ich brauche den Wert:"HKEY_LOCAL_MACHINE\SOFTWARE\Testsoftware\Rocker" und dann den Schlüssel "installation_directory"
Also ich:
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Testsoftware\Rocker" /v "installation_directory" >"%temp%\tempx.txt"
! REG.EXE VERSION 3.0
HKEY_LOCAL_MACHINE\SOFTWARE\Testsoftware\Rocker
installation_directory REG_SZ C:\appl\Programme\Testsoftware\Rocker\
Ich hatte mir vorgestellt dass ich das mit einer FOR Anweisung hin bekomme in etwa so:
FOR /F "tokens=35* skip=4" %%G IN ("%temp%\tempx.txt") do set STRING=%%G
Kann mir da jemand helfen?
Please also mark the comments that contributed to the solution of the article
Content-Key: 178114
Url: https://administrator.de/contentid/178114
Printed on: April 24, 2024 at 23:04 o'clock
2 Comments
Latest comment
Hallo Irohead.Hayns gegen eine Begrüßung habe ich nichts einzuwenden,
teste mal
oder auch (ohne TEMP-Datei)
Gruß
Friemler
teste mal
FOR /F "usebackq tokens=2* skip=3" %%G IN ("%temp%\tempx.txt") do set STRING=%%H
oder auch (ohne TEMP-Datei)
FOR /F "tokens=2* skip=3" %%G IN ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Testsoftware\Rocker" /v "installation_directory"') do set STRING=%%H
Gruß
Friemler