<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: Получение ProductKey установленных Windows и MS Office]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=522&amp;type=atom" />
	<updated>2007-06-28T10:35:07Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=522</id>
		<entry>
			<title type="html"><![CDATA[VBScript: Получение ProductKey установленных Windows и MS Office]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=3316#p3316" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2007-06-28T10:35:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=3316#p3316</id>
		</entry>
</feed>
