WMI CIM Like statement will not work on Server 2000

Posted on 2008-11-05
Last Modified: 2008-11-05
I have built a small VBScript to move a few files around our network as they come in via FTP. On my workstation (XP SP2) I can run and return results back for the following WMI CMI query to collect all files that have FILE in the name (the files all have this trait)::

Set objFileList = objWMIService.ExecQuery _
         ("Select * from CIM_Datafile Where Path = '\\ftpinbound\\' And FileName Like '%FILE%'")

When I moved this script to my file server for production I get no results for this query. However, if I change the script to:

Set objFileList = objWMIService.ExecQuery _
         ("Select * from CIM_Datafile Where Path = '\\ftpinbound\\' And FileName = 'FILE'")

I get results for the files named (for example file.001) and not the ones named (for example file1022.001).

Any ideas? All the stuff I have read says that this query will work on Server 2000 but I cant seem to figure out what the deal is with the Like statement.
Question by:dna404
    LVL 41

    Expert Comment

    Yep, that's correct... the LIKE operator was added with WinXP

    Author Comment

    Will it work on 2003 Server?
    LVL 41

    Accepted Solution

    Yep, XP and beyond

    Author Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
    Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  ( Here (http…
    This video discusses moving either the default database or any database to a new volume.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now