Relevance for Reg Value that contains "%"

(imported topic written by SystemAdmin)

I have created the following relevance:

values of key “HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” of registry

Which returns:

%USERPROFILE%\Application Data

%USERPROFILE%\Desktop

%USERPROFILE%\Favorites

.

.

.

What I really need to find is if any of the values do not have %USERPROFILE% in the path. I am having a issue creating the correct syntax to account for the “%”

What I have right now is:

exists values whose (it as string as lowercase contains “u:”)of key “HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” of registry as string or exists values whose (it as string as lowercase contains “msad”)of key “HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” of registry as string

This will detect if any of the paths contain “u:” or “msad”, but what I really need is a relevance that will tell me if any of the values do not contain "%USERPROFILE%.

Any help would be greatly appreciated.

Thanks

(imported comment written by jessewk)

The percent character is reserved for percent encoding. If you want a literal percent character, you have to use the percent encoded value for the percent character, which is %25.

Try this:

exists value
whose
(
it as string does not contain “%25USERPROFILE%25”
)
of key “HKEY_USERS\S-1-5-18\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” of registry

(imported comment written by SystemAdmin)

Thanks Jesse, I was using the %25 in a previous relevance, but kept getting errors. The relevance you attached works perfectly. I think the problem that I had was “it as string does not contain …”

Thanks for your help