<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; VBScript: определение версии операционной системы]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=52</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=52&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «VBScript: определение версии операционной системы».]]></description>
		<lastBuildDate>Thu, 13 Jul 2006 08:11:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[VBScript: определение версии операционной системы]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=77#p77</link>
			<description><![CDATA[<p>Пример скрипта:<br /></p><div class="codebox"><pre><code>Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&quot;)
If Err.Number &lt;&gt; 0 Then
    WScript.Echo Err.Number &amp; &quot; &quot; &amp; Err.Description
    WScript.Quit
End If
Set colOperatingSystems = objWMIService.ExecQuery(&quot;Select * from Win32_OperatingSystem&quot;)
strInfo = vbNullString
For Each objOperatingSystem in colOperatingSystems
    strInfo=objOperatingSystem.Caption &amp; &quot; &quot; &amp; objOperatingSystem.Version
    Exit For
Next
WScript.Echo strInfo</code></pre></div><p>А вот так это можно сделать из 1С v7.7:<br /></p><div class="codebox"><pre><code>Попытка
    ScrptCtrl=СоздатьОбъект(&quot;MSScriptControl.ScriptControl&quot;);
    ScrptCtrl.Language=&quot;vbscript&quot;;
    ScrptCtrl.AddCode(&quot;
    |Function GetVer()
    |    Set objWMIService = GetObject(&quot;&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&quot;&quot;)
    |    Set colOperatingSystems = objWMIService.ExecQuery(&quot;&quot;Select * from Win32_OperatingSystem&quot;&quot;)
    |    strInfo=vbNullString
    |    For Each objOperatingSystem in colOperatingSystems
    |        strInfo=objOperatingSystem.Caption &amp; &quot;&quot; &quot;&quot; &amp; objOperatingSystem.Version
    |        Exit For
    |    Next
    |    GetVer=strInfo
    |End Function
    |&quot;);
    ТекстВерcии=СокрЛП(ScrptCtrl.Run(&quot;GetVer&quot;));
    Сообщить(ТекстВерcии);
Исключение
    Сообщить(ОписаниеОшибки());
КонецПопытки;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (The gray Cardinal)]]></author>
			<pubDate>Thu, 13 Jul 2006 08:11:51 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=77#p77</guid>
		</item>
	</channel>
</rss>
