Batch Datei Text in .txt Datei finden

Andreas83

Grünschnabel
Hallo zusammen,

ich suche eine Möglichkeit aus einer Text Datei ausschließlich den Office Key auszulesen.

Txt sieht so aus:

==================================================
Product Name : Microsoft Office Professional Plus 2013
Product ID : 00216-00000-00000-AA241
Product Key : xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
Installation Folder : C:\Program Files\Microsoft Office\Office15\
Service Pack :
Computer Name : AB
Modified Time : 15.08.2013 14:38:20
==================================================

==================================================
Product Name : Microsoft Visio Professional 2013
Product ID : 00219-00000-00000-AA798
Product Key : yyyyy-yyyyy-yyyyy-yyyyy-yyyyy
Installation Folder : C:\Program Files\Microsoft Office\Office15\
Service Pack :
Computer Name : AB
Modified Time : 15.04.2014 07:13:14
==================================================


Hiermit erstelle ich mir eine neue Datei die aber bei Key beinhaltet, ich möchte aber nur den Office Key.

TYPE ProduKey.txt | find "Product Key" >winkey.txt
type winkey.txt | find ": Product key was not found"
if %errorlevel% equ 0 set value=Win Prod Key not found & goto setreg
for /f "tokens=3 delims=:, " %%i in (winkey.txt) DO set value=%%i


Jemand eine Idee?

Vielen Dank
Gruß Andreas
 

Neue Beiträge

Zurück