Finding files in users mydocuments

(imported topic written by nipperjones91)

hey i’m trying to write some relevance to find if the current logged in user has an outlook archive file… so far i have tried the following with no luck…

exists file “archive.pst” of folder “C:\Documents and Settings{name of current user}\Local Settings\Application Data\Microsoft\Outlook”

and i have also tried

exists file “archive.pst” of folder “C:\Documents and Settings%USERNAME%\Local Settings\Application Data\Microsoft\Outlook”

any ideas of how i could do this?

Cheers

(imported comment written by jeremylam)

Are you trying to do this in an action or in relevance?

The braces that separate relevance from actionscript don’t have the same function outside of the action, so in your first attempt the relevance is actually looking for a folder called …{name of current user}…

The “name of current user” inspector has to evaluated outside of the string, and then the folder inspector needs to work on all three parts of the string concatenated together, as so:

exists file “archive.pst” of folder (“C:\Documents and Settings” & name of current user & “\Local Settings\Application Data\Microsoft\Outlook”)

Also, the %USERNAME% variable would need to be explicitly expanded, and the ‘%’ signs encoded:

expand environment string of “%25USERNAME%25”

However, the BES client runs as the SYSTEM user, so that’s probably not the way to go.