Windows environment variables

(imported topic written by Mosbey91)

I am trying to write a relevance statment for an action. I want to check for the existance of a file before performing the action. When I run my statement throught the QNA with the full path name and then run it with the environment variable I get different results. I would like it to run with the environment variable and evaluate to true. Am I doing something wrong? Below is the results of the statements in QNA.

q:exists file “c:\documents and settings\is003pf\My Documents\xyz.html”

A: True

q:exists file “%25userprofile%25\My Documents\xyz.html”

A: False

(imported comment written by Lee Wei)

Hi Mosbey,

Your %25userprofile%25 is not expanded and will be treated as a string.

Try this instead:

q: exists file (value of variable “userprofile” of environment & “\My Documents\xyz.html”)

However, be careful that when you run this from the BigFix Client, the userprofile is that of System, instead of the login user.

This might be a useful post to get more info: http://forum.bigfix.com/viewtopic.php?id=1909

Lee Wei

(imported comment written by Mosbey91)

Lee - That worked Great. Many Thanks!!