I am not sure if you meant “C:\Docs and Settings” literally, or if you are referring to the user home directory. Assuming the latter, here is a query that will return the folder for the current user:
value “Local Settings” of key “Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” of current user keys (logged on users) of registry
On my computer, that would be C:\Documents and Settings\lee_wei\Local Settings.
With that info, we can proceed with finding the XML files as follows:
names of files whose (name of it ends with “.xml”) of folder ((it as string & “\Application\Pandion”) of value “Local Settings” of key “Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” of current user keys (logged on users) of registry)
Note that this does not run using the Relevance Debugger because it does not have the BigFix Client context. You can download my BES Client API Tester for easy testing: http://forum.bigfix.com/viewtopic.php?id=2756. Or you can simply put this statement into the BES Console.
Secondly, note that I did not check for the existence of the folder we are querying.
my stupidty led us down the wrong path name and I am looking for a folder name, not an XML file…sorry… This is what it should be but it simply says error in the API test
names of folders of folder ((it as string & “\Pandion\Profiles”) of value “AppData” of key “HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” of current user keys (logged on users) of registry)
Also I would like the if exists because not every user will have this installed.
Assuming that this is the directory structure that you are after:
C:\Documents and Settings\lee_wei\Application Data\Pandion\Profiles
The relevance statement can be the following to return the folders within the directory:
names of folders of folder ((it as string &
"\Pandion\Profiles") of value
"AppData" of key
"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" of current user keys (logged on users) of registry)
If we were to add and if-then-else statement to check for the existence of the folder, it would be:
if (exists folder ((it as string &
"\Pandion\Profiles") of value
"AppData" of key
"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" of current user keys (logged on users) of registry)) then (names of folders of folder ((it as string &
"\Pandion\Profiles") of value
"AppData" of key
"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" of current user keys (logged on users) of registry) )
else (
"Not applicable")