Whats the frequency of the letter b in:
Q: Detecting a registry key with a space in the path from the CLI (or .bat file)? Ive run into a problem in which my experience (and Google-fu) have let me down.
Basically, I need to push out KB968730 to a couple hundred clients or so.  Naturally, would like to check for the installation of the hotfix before kicking off the install.  Sadly, I need to do this with a script and a GPO, rather than a proper system like SCCM.  Not normally something that would give me any issues, but, there seems to be a catch.
The catch is that the path to the registry key this hotfix installs has a bloody space in it.  Specifically, it installs to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB968730.
No surprise then, that the standard batch file/CMD command reg.exe query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB968730 throws a syntax error and messes up the installation check part of my batch file - its seeing the second part of the path as a second argument.  So, of course, I tried encapsulating the path in double quotes, no joy.  Single quotes, no joy.  Threatening my operating system and/or Microsoft also did not produce results.
After some Googling and expletives, I found what seems to be a solution to this, but cant quite get it working, for some reason I cant figure out.  (Undoubtedly because my coding skills are weak these days and string tokenization threw me for a loop at the best of times.)
Seems like what I want to use is something like:
for /f Tokens=2,* %%a in (‘reg.exe HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB968730 /v Path’) do (set xpath=%%a) and then work with %xpath%, but thats not working.  Having tokens set to 1 gives me path before the space, set to 2 gives me the path after the space, and I cant figure out how to append the one value to the other.  Particularly frustrating since all the answers Ive seen said thanks, it worked!!! or similar.  *(With the caveat that you remove one % when executing directly on the command line.)
Anyone know what Im messing up here?
Alternately, if anyone still uses VBS and knows how to do it with that, Id happily jump at that option.  (No PowerShell, though, on account of our XP client not having it installed.)
P.S., if this is better suited for StackOverflow, Ive no issues with it being migrated, but my initial thought was that we dont appreciate developers coming in here and asking [to us] trivial questions about setting up their dev machines, so I thought theyd probably feel the same way about my question.

A: Double quotes seem to work fine for registry paths containing spaces. Ive just tested on Windows XP SP3 here.  The following returns the expected keys/values:
REG QUERY HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion

Should you want to use tokens, youll need to use the delims option to specify not to use space/tab as a delimiter. From FOR /?:

   delims=xxx      - specifies a delimiter set.  This replaces the
                     default delimiter set of space and tab.


Simple batch example  using ; as a delimiter.
FOR /F usebackq delims=; %%A IN (`REG QUERY HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB968730 /v Path`) DO (
    SET XPATH=%%A
)

In addition, you may find the wmic utility helpful.  It comes with XP and uses WMI to do its thing.  You can do a quick check for your KB with something like:
wmic qfe list brief | FIND /I KB968730


user
I counted thirty-eight "b"s in that text.
assistant