1

I have the registry path in a variable %A%. And I want to get the child name of that registry path and to execute the below command

MSIEXEC.EXE /qb /L* "%LOGDIR%\myuninstaller.log" /x{GUID}

Example:

SET %A%="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C43A01F0-D4DB-4CA3-9DF6-7DF629BBCCD4}"

How can I get exactly this string "{C43A01F0-D4DB-4CA3-9DF6-7DF629BBCCD4}" ?

Nomesh DeSilva
  • 1,649
  • 4
  • 25
  • 43
Hse7en
  • 11
  • 3

1 Answers1

1
for /f "tokens=2 delims={" %%# in ("%A%") do set "guid={%%#"

if the length is fixed (it should be) you can use substring syntax:

set "guid=%A:~-38%"
Community
  • 1
  • 1
npocmaka
  • 55,367
  • 18
  • 148
  • 187