From: Pegasus [MVP] on 1 Dec 2009 18:23 "yawnmoth" <terra1024(a)yahoo.com> wrote in message news:e25f6c20-a25f-4f54-a66f-68fbd56a5a5f(a)j14g2000yqm.googlegroups.com... On Dec 1, 3:04 am, "Pegasus [MVP]" <n...(a)microsoft.com> wrote: > "yawnmoth" <terra1...(a)yahoo.com> wrote in message > > news:19802930-0ca5-48e5-ba5e-f9213b215659(a)e27g2000yqd.googlegroups.com... > > > Say you're in regedit and in the HKEY_CURRENT_USER\whatever\whatever > > you have a bunch of entries with backslashes in their name. How would > > you read those registry entries? An example of this is the following: > > > HKCU\Software\Microsoft\Windows\ShellNoRoam\MUICache > > > A lot of the entry names are paths. If the paths were the entry > > values, reading them would be easy enough, but since they're the > > names, I'm at a loss. Any ideas? > > You could use this generalised script to extract your keys and values: I don't want to extract all keys, though - I just want one key. Like this one, for example: HKCU\Software\Microsoft\Windows\ShellNoRoam\MUICache\C:\WINDOWS \system32\mspaint.exe, for example. Problem is, written like that, VBScript thinks it's trying to get the mspaint.exe key within system32 within WINDOWS, etc, as opposed to the C:\WINDOWS\system32\mspaint.exe key within MUICache within ShellNoRoam, etc. And plus, what if I want to edit it? ============= Sorry, after reading your reply four times I'm still unable to wrap my mind around it. Please rephrase what you're trying to achieve. As for editing: If you mean "writing a registry value" you could use the WshShell object mentioned by mayana. The RegWrite method will do it for you - see the explicit example in the downloadable helpfile script56.chm.
From: mayayana on 1 Dec 2009 18:43 I think maybe he means that the value name is C:\WINDOWS\system32\mspaint.exe ? I was assuming that he was having trouble with value names that have backslashes embedded. WScript.Shell can't handle those. That's why I provided the link to a WMI Reg. class. I thought that was also why you posted a WMI method. To yawnmoth: Maybe you should post the code you're trying. If you have embedded "\" then try the class I posted. Also, it helps to have the terms straight. A key is the one that looks like a folder in Regedit. When you open a key, what's on the left is a value. What's on the right is data. So there are keys, values, and data - or "value data".
First
|
Prev
|
Pages: 1 2 Prev: Permission denied MsgBox Next: keylogger with dynamicwrapperx case study #4 |