<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; WSH: Получение кода установки Windows]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=8546</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8546&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «WSH: Получение кода установки Windows».]]></description>
		<lastBuildDate>Sat, 10 Aug 2013 10:13:10 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: WSH: Получение кода установки Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=74368#p74368</link>
			<description><![CDATA[<p>У меня такая же ошибка, если скрипт выполняется 32-битным WScript.exe. В 32-битном разделе CurrentVersion нет параметра DigitalProductId.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sat, 10 Aug 2013 10:13:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=74368#p74368</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Получение кода установки Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=74366#p74366</link>
			<description><![CDATA[<p>Строка: 3, Не удается открыть для чтения раздел реестра &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId&quot;.<br />Windows 7 HB, SP1, x64.</p>]]></description>
			<author><![CDATA[null@example.com (omegastripes)]]></author>
			<pubDate>Sat, 10 Aug 2013 09:50:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=74366#p74366</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Получение кода установки Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=74307#p74307</link>
			<description><![CDATA[<p>понял, спасибо, значит вариант 2 был...</p>]]></description>
			<author><![CDATA[null@example.com (im2002)]]></author>
			<pubDate>Thu, 08 Aug 2013 06:49:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=74307#p74307</guid>
		</item>
		<item>
			<title><![CDATA[Re: WSH: Получение кода установки Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=74304#p74304</link>
			<description><![CDATA[<p>У меня код совпал с тем, что на этикетке. W7 HP 64.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Thu, 08 Aug 2013 04:54:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=74304#p74304</guid>
		</item>
		<item>
			<title><![CDATA[WSH: Получение кода установки Windows]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=74303#p74303</link>
			<description><![CDATA[<p>Иногда возникает ситуация, когда код установки Windows потерян, этикетку заляпали, оторвали на половину и т.п.&nbsp; Как его узнать из &quot;ещё работающей&quot; ОС? В инете нашёл решение для Win8, логично предположил, что оно работает и для Win7. Недавно переставлял win7 &quot;домашняя базовая&quot;, этикетка присутствовала, просто решил проверить работу скрипта... Установил, когда в третий раз не смог активировать, полез смотреть в этикетку, там совсем другой код... <br />Варианта 2: <br />1) скрипт работает не правильно; <br />2) &quot;продавцы в магазине&quot; не пользовались кодом установки того продукта, который официально продали (что конечно странно?!)<br />В запарке не проверил работу скрипта, после того как активировал Win с помощью кода на этикетке.<br />Скрипт вот такой:<br /></p><div class="codebox"><pre><code>Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
regKey = &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\&quot;
DigitalProductId = WshShell.RegRead(regKey &amp; &quot;DigitalProductId&quot;)

Win8ProductName = &quot;Windows Product Name: &quot; &amp; WshShell.RegRead(regKey &amp; &quot;ProductName&quot;) &amp; vbNewLine
Win8ProductID = &quot;Windows Product ID: &quot; &amp; WshShell.RegRead(regKey &amp; &quot;ProductID&quot;) &amp; vbNewLine
Win8ProductKey = ConvertToKey(DigitalProductId)
strProductKey =&quot;Windows 8 Key: &quot; &amp; Win8ProductKey 
Win8ProductID = Win8ProductName &amp; Win8ProductID &amp; strProductKey 

MsgBox(Win8ProductKey)
MsgBox(Win8ProductID)

Function ConvertToKey(regKey)
    Const KeyOffset = 52
    isWin8 = (regKey(66) \ 6) And 1
    regKey(66) = (regKey(66) And &amp;HF7) Or ((isWin8 And 2) * 4)
    j = 24
    Chars = &quot;BCDFGHJKMPQRTVWXY2346789&quot;
    Do
        Cur = 0
        y = 14
        Do
            Cur = Cur * 256
            Cur = regKey(y + KeyOffset) + Cur
            regKey(y + KeyOffset) = (Cur \ 24)
            Cur = Cur Mod 24
            y = y -1
        Loop While y &gt;= 0
        j = j -1
        winKeyOutput = Mid(Chars, Cur + 1, 1) &amp; winKeyOutput
        Last = Cur
    Loop While j &gt;= 0
    If (isWin8 = 1) Then
        keypart1 = Mid(winKeyOutput, 2, Last)
        insert = &quot;N&quot;
        winKeyOutput = Replace(winKeyOutput, keypart1, keypart1 &amp; insert, 2, 1, 0)
        If Last = 0 Then winKeyOutput = insert &amp; winKeyOutput
    End If
    a = Mid(winKeyOutput, 1, 5)
    b = Mid(winKeyOutput, 6, 5)
    c = Mid(winKeyOutput, 11, 5)
    d = Mid(winKeyOutput, 16, 5)
    e = Mid(winKeyOutput, 21, 5)
    ConvertToKey = a &amp; &quot;-&quot; &amp; b &amp; &quot;-&quot; &amp; c &amp; &quot;-&quot; &amp; d &amp; &quot;-&quot; &amp; e
End Function</code></pre></div><p>Вопрос: он работать корректно должен? Может кто знает другой рецепт, для описанного случая?<br />Т.е. как получить код установки продукта из уже установленной ОС Win7</p>]]></description>
			<author><![CDATA[null@example.com (im2002)]]></author>
			<pubDate>Thu, 08 Aug 2013 04:36:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=74303#p74303</guid>
		</item>
	</channel>
</rss>
