Why does WQL query "SELECT * FROM Win32_Directory WHERE Name = "C:\WINDOWS" fail?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Max Carper (v-maxc_at_microsoftDELETETHISPART.com)
Date: 06/03/04


Date: Thu, 3 Jun 2004 09:56:05 -0700

Hello,

These two WMI WQL queries seem so simple... anyone know why they both return invalid query errors, regardless of what valid string I use for the "Name = " parameter?

SELECT * FROM Win32_Directory WHERE Name = "C:\WINDOWS"
SELECT * FROM CIM_Datafile WHERE Name = "C:\IO.SYS"

I'm not having any problems executing a similar query:

SELECT * FROM WMIWin32_Group WHERE LocalAccount = TRUE

The only difference I can see is that the first two use strings in the WHERE clause. I've tried with single quotes, and double quotes, and both return the same error. Please help! Thanks! :)

Regards,
Maximillian R. Carper



Relevant Pages

  • Re: user-defined wildcard query
    ... query's WHERE clause, but I suspect you might not know what ... To use that in the query design grid, ... This is because strings are compared left to right ... I just thought of a way to do the conversion as long as ...
    (microsoft.public.access.queries)
  • Re: user-defined wildcard query
    ... "Marshall Barton" wrote: ... query's WHERE clause, but I suspect you might not know what ... To use that in the query design grid, ... This is because strings are compared left to right ...
    (microsoft.public.access.queries)
  • Re: Weird Parameter problem
    ... Strings of these also. ... try using the WHERE Clause for the criteria rather than HAVING ... it may be more efficient to put the data criterion in the Query ...
    (microsoft.public.access.queries)
  • Re: Newbie at mixing ADO and Excel
    ... I have tried just taking the actual query out of the SP and making sure the ... quotes, 'cause that's what works. ... When I pass the date strings in to ... the SP, I pass them in with single quotes around them, so my question is, do ...
    (microsoft.public.excel.programming)
  • Re: problem with IN() syntax
    ... I am getting a list of numeric values from a form and using it in a query ... I've tried about a dozen combinations of double quotes and single quotes ... around the digits and around the whole thing and placed the entire IN ...
    (microsoft.public.access.queries)