Help with relevance query to add clients to Computer Group

I am wanting to use a relevance lang. query to populate a 'Computer Group". This would ideally be for both Windows and Linux and be along the lines of:

exists “d:\filename.txt” is true – For Windows
exists “/data/filename.txt” is true – For Linux

But it does not seem to be working, what am I missing?

You appear to be testing the existence of the string, not the existence of a file with the pathnames specified.

1 Like

How about something like:

exists file "filename.txt" of folder (if (windows of operating system) then "D:\" else "/data")

1 Like

So I tried this and it worked great on Linux but still is not seeing the Windows box. Yet I can see the file at this location (RDP to server).

I use this for a similar check:
if (exists operating system whose (name of it starts with “Win”)) then (exists file “d:\filename.txt”) else (exists file “/data/filename.txt”)

2 Likes

This worked perfectly, thank you Baynes74 and to all whom replied.