Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WMI filter when a file does not exists

1,782 views
Skip to first unread message

George Steiger

unread,
Oct 16, 2008, 4:09:01 AM10/16/08
to
A policy should be applied only when a specific file does *NOT* exists. Is
there someone that knows how to write a WMI filter for this specific problem.

Thanks George

Florian Frommherz [MVP]

unread,
Oct 16, 2008, 4:53:34 AM10/16/08
to
George,

George Steiger schrieb:


> A policy should be applied only when a specific file does *NOT* exists. Is
> there someone that knows how to write a WMI filter for this specific problem.

NOT constructs are always tricky in WMI - at least for what I've seen. I
guess you already have found a way to check for a file, I'd go about it
like this:

Select * From Win32_Directory Where Name = 'C:\\Folder\\myFile.txt'

I'd try to do something lile <> instead of = to try to say "not equal" -
but I guess that will return true if there's some other file (beside the
myFile.txt) in the directory. You'd definitely have to try that out.

Another way of doing this kind of GPO filtering can be done with GP
Preferences. Have you already checked them out? They have a feature
called "Item-level targetting" which lets you choose filter criteria for
which the policy shall apply. Among a lot of filters, there's a
file/folder filter (you can even check for the file version!).

See: http://www.frickelsoft.net/blog/?p=127

cheers,

Florian

George Steiger

unread,
Oct 16, 2008, 5:50:01 AM10/16/08
to
Hi Florian

The <> can not work. It simply returns all other files. This means the WMI
Filter is evaluated to true. But this is not what im looking for. I need the
WMI Filter is evaluated to true if the specified file is *not* found.

Preferences are not an option.

George

0 new messages