Help! Singular expression refers to non-unique object.(In Registry)

(imported topic written by ahang91)

Here is the situation:

In my computer, the part of registry look like this:

Windows Registry Editor Version 5.00

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range1

“:Range”="10.89.

.

"

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges\Range2

“:Range”="10.89.

.

"

so, the “Range1” and “Range2” has a same value “:Range” with same result "10.89.

.

". I want delete these two keys, which are “Range1” and “Range2”, I wrote the action below:

if {(exists key whose (value “:Range” of it as string contains "10.89.

.

") of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges” of registry)}

appendfile

endif

But, the FixletDebugger got a error:“Singular expression refers to non-unique object.” so, I add “s” to “name” and “key”, the FixletDebugger got another error:“Singular expression required”.

Now, I cann’t delete these two keys, How can I do? Please help me, tks!

(imported comment written by NoahSalzman)

Will they always be at the paths “Range1” and “Range2” or are you really trying to delete any key such as \Range\RangeX?

If the answer is "it will always be Range1 and Range2 then create two “appendfile [-” lines, one for each key.

(imported comment written by ahang91)

No, the “Range**” is random. hehe.

(imported comment written by ahang91)

hello, any one can help me??? tks, I’m waitting…

(imported comment written by NoahSalzman)

It’s the Christmas Holiday in the US (where the majority of Forum users live) so you’re not going to get a quick response right now.

I recommend doing some reading/studying using this Google search:

site:forum.bigfix.com “appendfile [-”

The problem that makes this a little tricky is that you need to build your appendfile lines, the ones that delete registry keys, one by one. That is, you have to have Relevance queries that return a single key when you “paste” them into your “appendfile [-” Action Script lines.

(imported comment written by ahang91)

Oh, sorry, I forgot…I’m Chinese, hehe.

merry xmas!

(imported comment written by ahang91)

so many days… I have been desperate… 55555

(imported comment written by NoahSalzman)

You are going to need to construct something that follows

this pattern

.

Step 1: figure out what Relevance statement you need to return a list of keys you want to delete

Step 2: work in the “end of line trick” using “%0d%0a” so that you are creating multiple registry delete lines

Step 3: use the Action Script “appendfile” to write out those lines into a .reg file

Step 4: execute the .reg file

(imported comment written by ahang91)

Thank you! Very very thank you!

I wrote this:

appendfile {("%0d%0a") of (names of (keys whose (value “:Range” of it as string contains "10.89.

.

") of key (“HKEY_USERS” & substring separated by “” whose (it contains “S-1-5-21”) of (names of values of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist” of registry) whose (it contains “S-1-5-21” and it does not contain “Classes”) & “\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Ranges”) of registry))}

It’s done!