Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

WMI CIM Like statement will not work on Server 2000

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.
0
dna404
Asked:
dna404
  • 2
  • 2
1 Solution
 
grayeCommented:
Yep, that's correct... the LIKE operator was added with WinXP
0
 
dna404Author Commented:
Will it work on 2003 Server?
0
 
grayeCommented:
Yep, XP and beyond
0
 
dna404Author Commented:
Thanks.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now