I thought I would share the following relevance that will return te path to screensaver, first if set by policy, second manually, and finally by theme … the results look good in my environment.
Question is, does anyone have anything a little slicker and less recursive ?
I found it necessary to query both (current user keys (logged on users) of native registry) and the user SID for the SCRNSAVE.EXE value.
if (not Windows of operating system) then “N/A” else if (number of logged on users = 1) then if (exists keys “Software\Policies\Microsoft\Windows\Control Panel\Desktop” whose (exists values whose (name of it = “SCRNSAVE.EXE” ) of it) of current user keys (logged on users) of native registry) then (expand environment string of (value “SCRNSAVE.EXE” of key “Software\Policies\Microsoft\Windows\Control Panel\Desktop” of current user keys (logged on users) of native registry as string)) else if (number of logged on users = 1) then if (exists keys “Software\Policies\Microsoft\Windows\Control Panel\Desktop” whose (exists values whose (name of it = “SCRNSAVE.EXE”) of it) of key (“HKU” & (component string of sid of security account (name of logged on user))) of native registry) then (expand environment string of(value “SCRNSAVE.EXE” of key (“HKU” & (component string of sid of security account (name of logged on user)) & “\Software\Policies\Microsoft\Windows\Control Panel\Desktop”) of native registry as string)) else if (number of logged on users = 1) then if (exists keys “Control Panel\Desktop” whose (exists values whose (name of it = “SCRNSAVE.EXE” ) of it) of current user keys (logged on users) of native registry) then (expand environment string of(value “SCRNSAVE.EXE” of key “Control Panel\Desktop” of current user keys (logged on users) of native registry as string)) else if exists folder (name of drive of system folder & “\Users” & name of logged on user & “\AppData\Local\Microsoft\Windows\Themes”) whose (exists file whose (name of it as lowercase ends with “.theme” as lowercase ) whose (line of it as lowercase contains “SCRNSAVE.EXE” as lowercase) of it) then expand environment string of following text of first “SCRNSAVE.EXE=” of lines of file whose (name of it as lowercase ends with “.theme” as lowercase) of folder (name of drive of system folder & “\Users” & name of logged on user & “\AppData\Local\Microsoft\Windows\Themes”) else “N/A” else “N/A” else “N/A” else “N/A”