<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Library &#187; WMI</title>
	<atom:link href="http://www.ucosoft.com/tag/wmi/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ucosoft.com</link>
	<description>Free Source Code and Program Tips</description>
	<lastBuildDate>Thu, 22 Jul 2010 05:17:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Retrieving a class and WMI class</title>
		<link>http://www.ucosoft.com/retrieving-a-class-and-wmi-class.html</link>
		<comments>http://www.ucosoft.com/retrieving-a-class-and-wmi-class.html#comments</comments>
		<pubDate>Mon, 18 Dec 2006 02:48:32 +0000</pubDate>
		<dc:creator>hamo</dc:creator>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.ucosoft.com/archives/60.html</guid>
		<description><![CDATA[Note: This a part from MSDN, just for self refference. The copyright is handled by Microsoft. The first type of object you can retrieve is a WMI class. When retrieving a WMI class, you actually retrieve a class definition: that is, a listing of the properties, qualifiers, and methods that fully describe the class. However, [...]]]></description>
			<content:encoded><![CDATA[<p><strong><em>Note: This a part from <a href="http://msdn.microsoft.com" rel="nofollow">MSDN</a>, just for self refference. The copyright is handled by Microsoft.</em></strong> </p>
<p>The first type of object you can retrieve is a WMI class. When retrieving a WMI class, you actually retrieve a class definition: that is, a listing of the properties, qualifiers, and methods that fully describe the class. However, a class definition is for all purposes the class itself.</p>
<p><strong>To retrieve a class definition in VBScript</strong> </p>
<p>You can retrieve the class definition with the VBScript call <b>GetObject</b>, but do not specify a specific instance in the object path for the class.  </p>
<p>The following code example retrieves the class definition for the class that describes logical drives on your computer. For information on the defaults that are being used, see <strong>Using Defaults for More Concise Code</strong>. </p>
<p>Visual Basic and VBScript support the following syntax:<br />
<coolcode lang="vbs" linenum="no"><br />
Set objinst = GetObject(&#8220;WinMgmts:Win32_LogicalDisk&#8221;)<br />
</coolcode></p>
<p>Windows Script Host also supports:<br />
<coolcode lang="xml" linenum="no"><br />
<OBJECT id="myLocator" progid="WbemScripting.SWbemLocator"></OBJECT><br />
</coolcode><br />
<span id="more-60"></span></p>
<p>A class or instance can also be specified, in which case the returned object is a WMI object rather than a services object. </p>
<p>The <b>GetObject</b> function provided by VBScript and JScript cannot be used when running scripts embedded within an HTML page, as MicrosoftÂ® Internet Explorer disallows the use of this call for security reasons. This function also cannot be used to create an instance of the &#8220;generic&#8221; object <b>SWbemObject</b>.<P></P><br />
<strong>To retrieve a class definition in C++</strong></p>
<p>Call the <b>IWbemServices::GetObject</b> or <b>IWbemServices::GetObjectAsync</b> methods to retrieve the definition of a class. </p>
<p>A single class can have multiple class definitions, usually when you have more than one class provider loaded into a single namespace. When a class has multiple class definitions, WMI returns the first definition discovered and the WBEM_S_DUPLICATE_OBJECTS status code.</p>

	Tags: <strong><a href="http://www.ucosoft.com/tag/script" title="Script" rel="tag">Script</a>, <a href="http://www.ucosoft.com/tag/wmi" title="WMI" rel="tag">WMI</a></strong><br />
]]></content:encoded>
			<wfw:commentRss>http://www.ucosoft.com/retrieving-a-class-and-wmi-class.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

