Im trying to determine the locations of my customers My Documents target. The registry key and value im am working with is below. Because Im working in the HKCU hive need this to be run when a user is present and it looks like you cannot set an “analysis” only target workstations with a user present. Any ideas on my other options? Im basically trying to determine if “My Docs” are being stored locally or on the customers network share. Thanks for your help!
value “Personal” of keys “Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” of current user key (logged on users) of registry
If you are before 7.0 try something like this:
if (exists current user) then (value “Personal” of key “Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” of (key whose ((it = name of current user as lowercase OR it starts with name of current user as lowercase & “@” ) of (it as string as lowercase) of value “Logon User Name” of key “Software\Microsoft\Windows\CurrentVersion\Explorer” of it) of key “HKEY_USERS” of registry)) else “No Current User”
The 7.0 version will return nothing if there is no logged on user. The 6.0 version will return “No Current User”. You can wrap the 7.0 version in the same if clause as the 6.0 if you’d like it to also return “No Current User” … except I’d use (if not exists logged on user then … else …)