<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; VBScript: Получение ProductKey установленных Windows и MS Office]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=522</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=522&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «VBScript: Получение ProductKey установленных Windows и MS Office».]]></description>
		<lastBuildDate>Thu, 28 Jun 2007 10:35:07 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[VBScript: Получение ProductKey установленных Windows и MS Office]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=3316#p3316</link>
			<description><![CDATA[<p>Скрипт опубликовал <strong>smaharbA</strong>.<br /></p><div class="codebox"><pre><code>Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
MicroSoft = &quot;HKLM\SOFTWARE\Microsoft&quot;
DigitalProductIdWindows = MicroSoft &amp; &quot;\Windows NT\CurrentVersion\DigitalProductId&quot;
On Error Resume Next
Set Word = CreateObject(&quot;Word.Application&quot;)
DigitalProductIdOffice = MicroSoft &amp; &quot;\Office\&quot; &amp; word.Version &amp; &quot;\Registration\&quot; &amp; _
    word.ProductCode &amp; &quot;\DigitalProductId&quot;
If Err.Number = 0 Then
    Word.Quit
    OfficeKey = GetKey(WshShell.RegRead(DigitalProductIdOffice))
    WScript.Echo &quot;Ключ MS Office: &quot; &amp; OfficeKey
Else
    WScript.Echo &quot;Возможно, MS Office не установлен.&quot;
End If
On Error GoTo 0
 
WindowsKey = GetKey(WshShell.RegRead(DigitalProductIdWindows))
WScript.Echo &quot;Ключ Windows: &quot; &amp; WindowsKey
 
Function GetKey(byval p)
    pc=&quot;BCDFGHJKMPQRTVWXY2346789&quot;
    For i=0 To 28
        a=0
        For j=0 To 14 
            a=p(66-j)+a*256 
            p(66-j)=(a\24) And 255 
            a=a Mod 24
        Next
        ProductKey = Mid(pc,a+1,1) &amp; ProductKey
        If (((i+2) Mod 6)=0) And (i&lt;28) Then
            i=i+1
            ProductKey = &quot;-&quot; &amp; ProductKey
        End If
    Next
    GetKey = ProductKey
End Function</code></pre></div><p>См. также: <a href="http://forum.script-coding.com/viewtopic.php?id=5197">CMD/BAT: Получение ProductKey установленной Windows</a>.</p>]]></description>
			<author><![CDATA[null@example.com (The gray Cardinal)]]></author>
			<pubDate>Thu, 28 Jun 2007 10:35:07 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=3316#p3316</guid>
		</item>
	</channel>
</rss>
