<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: список виртуальных USB Serial port]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6386&amp;type=atom" />
	<updated>2011-11-01T19:15:52Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6386</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: список виртуальных USB Serial port]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=53102#p53102" />
			<content type="html"><![CDATA[<p>У меня, например множество СОМ портов создал блютуф адаптер при подключении. Как мне найти только тот USB Serial port в который воткнут Silicon Labs CP210x USB to UART Bridge?</p>]]></content>
			<author>
				<name><![CDATA[Mat Skywalker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26275</uri>
			</author>
			<updated>2011-11-01T19:15:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=53102#p53102</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: список виртуальных USB Serial port]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=53063#p53063" />
			<content type="html"><![CDATA[<p>Добрый день</p><p>Как прочитать список виртуальных USB Serial port?</p><p>Таким образом они не обрабатываются:<br /></p><div class="codebox"><pre><code>On Error Resume Next
strComputer = &quot;.&quot;
Set objWMIService = GetObject(&quot;winmgmts:&quot; &amp; &quot;{impersonationLevel=impersonate}!\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
Set colItems = objWMIService.ExecQuery(&quot;Select * from Win32_SerialPort&quot;)

For Each objItem in colItems
    Wscript.Echo &quot;Device ID: &quot; &amp; objItem.DeviceID
Next</code></pre></div><p>Таким тоже не обрабатывается, хотя в <a href="http://www.codeproject.com/KB/dotnet/WMICodeCreator_Demo.aspx">http://www.codeproject.com/KB/dotnet/WM … _Demo.aspx</a> пишут, что должно (<strong>An article to illustrate a useful tool for WMI (WMICodeCreator) &amp; using WMI to find USB Serial / COM port adaptors</strong>).<br /></p><div class="codebox"><pre><code>Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\WMI&quot;)
   Set colItems = objWMIService.ExecQuery(&quot;SELECT * FROM MSSerial_PortName&quot;)</code></pre></div><p>Вопрос решен<br /></p><div class="codebox"><pre><code>HKLM = &amp;H80000002
Set oReg = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv&quot;)
strKeyPath = &quot;HARDWARE\DEVICEMAP\SERIALCOMM&quot;
oReg.EnumValues HKLM, strKeyPath, arrValueNames, arrValueTypes
For i=LBound(arrValueNames) To UBound(arrValueNames)
  oReg.GetStringValue HKLM, strKeyPath, arrValueNames(i), strValue
  MsgBox strValue
next</code></pre></div>]]></content>
			<author>
				<name><![CDATA[dandyd]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24647</uri>
			</author>
			<updated>2011-10-31T09:12:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=53063#p53063</id>
		</entry>
</feed>
