Current user profile path with text string added - managed property

I am trying to pull the current user profile path and then include a text string path without success.

My current property works if the profile matches the current user name:

exists files whose (name of it as lowercase is "settings.dat") of folders ("C:\Users\" & (name of logged on user) & "\AppData\Local\Packages\ClickSoftware.ClickMobileTouch_kkmypa1syex9e\Settings\")

But many users have a different profile path then their user name.

So I got around this by pulling the current user value of the profile path:

q: (value "ProfileImagePath" of key ("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\" & component string of sid of logged on user) of registry as string)

A: C:\Users\1sdemo90
T: 0.045 ms

but when I try to add text at the end of the value, it doesn’t get added:

q: (value "ProfileImagePath" of key ("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\" & component string of sid of logged on user) of registry as string) & "\AppData\Local\Packages\ClickSoftware.ClickMobileTouch_kkmypa1syex9e\Settings\settings.dat"

A: C:\Users\1sdemo90
T: 0.067 ms

I want this return:
C:\Users\1sdemo90\AppData\Local\Packages\ClickSoftware.ClickMobileTouch_kkmypa1syex9e\Settings\settings.dat

Any ideas why this doesn’t add the text at the end of the returned value?

Thanks,
Scott

Guess it is a problem with the “&” operator inside the “registry” inspector, not sure it is a bug :slight_smile: You can use the following a workaround to avoid using the “&” inside the registry inspector:

q: (value “Version” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BigFix\EnterpriseClient” of registry as string) & (value “EnterpriseClientFolder” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BigFix\EnterpriseClient” of registry as string) & “hello world”

A: 10.0.1.8C:\Program Files (x86)\BigFix Enterprise\BES Client\hello world

Hope it helps

1 Like

Thanks for the reply. I tried it, but it didn’t work with my statement.

Yours works:

q: (value "Version" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BigFix\EnterpriseClient" of registry as string) & (value "EnterpriseClientFolder" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BigFix\EnterpriseClient" of registry as string) & "hello world"

A: 9.5.9.62C:\Program Files (x86)\BigFix Enterprise\BES Client\hello world
T: 0.045 ms

But when I put that same statement behind mine, no good:

q: (value "ProfileImagePath" of key ("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\" & component string of sid of logged on user) of registry as string) & (value "EnterpriseClientFolder" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BigFix\EnterpriseClient" of registry as string) & "hello world"

A: C:\Users\1sdemo90
T: 0.056 ms

I am running in the local client evaluator mode to get the current user information. I am assuming it is because of logged on user piece of my statement?

Thanks,
Scott

In your expression I still see “&” inside the registry relevance To give you an idea see the following:

(value “ProfileImagePath” of key “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList” of registry as string) & (value “component string of sid of logged on user” of key “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList” of registry as string)

Make sure the above key names matches the actula names (“ProfileImagePath” ; “component string of sid of logged on user”). You may want to test each single expressions to make sure it returns the velue.

component string of sid of logged on user is an internal Bigfix statement that pulls the sid string from the registry for the current user, so I don’t believe your statement above will work.

I see, not sure if anyone else can help with some workaround here.

There looks to be a %00 at the end of the registry value that I guess is throwing off it being able to append another string after the results. This approach seems to work on my machine so maybe worth trying

Q: (preceding text of first "%00" of (value "ProfileImagePath" of keys whose (name of it = (component string of sid of logged on user as string)) of key "HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList" of registry as string)) & "\TEMP"
A: C:\Users\Some1\TEMP
T: 0.085 ms
2 Likes

Ahhh mystery solved! Thanks SLB, that worked. Thanks for the help!

Scott