Microsoft KB Archive/242507

{|
 * width="100%"|

INFO: Using Backslash in Windows Management Instrumentation Strings

 * }

Q242507

-

The information in this article applies to:


 * Windows Management Instrumentation, versions 1.0, 1.1, 1.5

-

SUMMARY
The backslash character, "\", is used by Windows Management Instrumentation (WMI) as an escape character in string constants, similar to the usage in C.

MORE INFORMATION
For example, to include a quote within a string constant, you must use \". If you want to have a backslash, you use \\.

Suppose you want to execute a query for the Win32_Directory object where the Name="C:\". You would need the following query:

select * from Win32_Directory where Name="C:\\" The __relpath of the object would be:

Win32_Directory.Name="C:\\" Additional query words: wmi wbem backslash string

Keywords : kbWBEM kbWMI100 _IK kbWMI110 kbWMI150

Issue type : kbinfo

Technology : kbWMISearch kbAudDeveloper kbWMI100 kbWMI110 kbWMI150