<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBA: изменение ключа продукта Windows XP]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=6055&amp;type=atom" />
	<updated>2011-07-29T07:41:34Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=6055</id>
		<entry>
			<title type="html"><![CDATA[Re: VBA: изменение ключа продукта Windows XP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=50252#p50252" />
			<content type="html"><![CDATA[<p>разобрался. ему не нравился конкретный ключ. сейчас все работает.<br />Спасибо за помощь.</p>]]></content>
			<author>
				<name><![CDATA[malegik]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27112</uri>
			</author>
			<updated>2011-07-29T07:41:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=50252#p50252</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBA: изменение ключа продукта Windows XP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=50221#p50221" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>alexii пишет:</cite><blockquote><p>В порядке бреда: заглавные/строчные буквы в ключе?</p></blockquote></div><p>неа, тот же результат.</p>]]></content>
			<author>
				<name><![CDATA[malegik]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27112</uri>
			</author>
			<updated>2011-07-27T13:00:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=50221#p50221</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBA: изменение ключа продукта Windows XP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=50219#p50219" />
			<content type="html"><![CDATA[<p>В порядке бреда: заглавные/строчные буквы в ключе?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-07-27T09:54:30Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=50219#p50219</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBA: изменение ключа продукта Windows XP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=50214#p50214" />
			<content type="html"><![CDATA[<p>Скрипт замечательно работает пока я не пытаюсь ввести ключ в скрипте, а не через аргумент. дело в том что это будет вторая часть скрипта который с начала будет проверять какой ключ установленый и потом,&nbsp; если он совподает с ключем на замену должен как раз и отрабатывать эту часть скрипта.&nbsp; <br />может тип не совпадает?</p>]]></content>
			<author>
				<name><![CDATA[malegik]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27112</uri>
			</author>
			<updated>2011-07-27T04:40:55Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=50214#p50214</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBA: изменение ключа продукта Windows XP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=50198#p50198" />
			<content type="html"><![CDATA[<p>Посмотрел на статьи:<br /><a href="http://support.microsoft.com/kb/328874/ru">Изменение ключа продукта, установленного по корпоративной лицензии, на компьютере под управлением Windows XP с пакетом обновления 1 (SP1)</a><br /><a href="http://support.microsoft.com/kb/918342/ru">Изменение ключа продукта для корпоративного лицензирования на компьютере с Windows XP или Windows Server 2003</a><br />— там именно Ваш вариант с заменой. Возможно, тогда читать это:<br /></p><div class="quotebox"><blockquote><p><strong>Remarks</strong>: This method is only validif the ActivationRequired property is equal to 1.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-07-26T15:56:36Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=50198#p50198</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBA: изменение ключа продукта Windows XP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=50197#p50197" />
			<content type="html"><![CDATA[<p>Судя по <a href="http://msdn.microsoft.com/en-us/library/aa393588(v=vs.85).aspx">SetProductKey Method of the Win32_WindowsProductActivation Class (Windows)</a>:<br /></p><div class="quotebox"><blockquote><p><em>ProductKey [in]</em></p><p>Unique product key that is licensed for use on the computer. <span style="color: Green">Product keys are alphanumeric strings of 25 characters formatted as follows: xxxxx-xxxxx-xxxxx-xxxxx-xxxxx.</span> The product key must be valid for the media type. Media types include retail, volume-licensing, and OEM.</p></blockquote></div><p>это:<br /></p><div class="quotebox"><blockquote><div class="codebox"><pre><code>VOL_PROD_KEY = Replace(VOL_PROD_KEY,&quot;-&quot;,&quot;&quot;) &#039;удалить дефисы, если они есть</code></pre></div></blockquote></div><p>лишнее.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-07-26T15:51:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=50197#p50197</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBA: изменение ключа продукта Windows XP]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=50190#p50190" />
			<content type="html"><![CDATA[<p>Добрый день.<br />Есть задача поменять ключ продукта XP на лицензионный. для этого патаюсь переделать скрипт от майкрософта <br /></p><div class="codebox"><pre><code>ON ERROR RESUME NEXT

if Wscript.arguments.count&lt;1 then
   Wscript.echo &quot;Нельзя запустить сценарий без аргумента VolumeProductKey argument&quot;
   Wscript.echo &quot;Правильное использование: Cscript ChangeVLKey.vbs xxxx-xxxxx-xxxxx-xxxxx-xxxxx&quot;
   Wscript.quit
end if

Dim VOL_PROD_KEY
VOL_PROD_KEY = Wscript.arguments.Item(0)
VOL_PROD_KEY = Replace(VOL_PROD_KEY,&quot;-&quot;,&quot;&quot;) &#039;удалить дефисы, если они есть
Dim WshShell
Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
WshShell.RegDelete &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WPAEvents\OOBETimer&quot; &#039;delete OOBETimer registry value
for each Obj in GetObject(&quot;winmgmts:{impersonationLevel=impersonate}&quot;).InstancesOf (&quot;win32_WindowsProductActivation&quot;)

   result = Obj.SetProductKey (VOL_PROD_KEY)

   if err &lt;&gt; 0 then
      WScript.Echo Err.Description, &quot;0x&quot; &amp; Hex(Err.Number)
      Err.Clear
   end if

Next</code></pre></div><p>Проблемма в том что если я явно указываю, а не через аргумент&nbsp; VOL_PROD_KEY, то он выдает общую ошибку&nbsp; <br />на строку result = Obj.SetProductKey (VOL_PROD_KEY) </p><div class="codebox"><pre><code>Dim VOL_PROD_KEY
VOL_PROD_KEY = &quot;3KGJ7-JPVFH-2KDK2-BH6CC-RHM8T&quot; 
VOL_PROD_KEY = Replace(VOL_PROD_KEY,&quot;-&quot;,&quot;&quot;) &#039;удалить дефисы, если они есть
WScript.Echo VOL_PROD_KEY
Dim WshShell
Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
WshShell.RegDelete &quot;HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WPAEvents\OOBETimer&quot; &#039;delete OOBETimer registry value
for each Obj in GetObject(&quot;winmgmts:{impersonationLevel=impersonate}&quot;).InstancesOf (&quot;win32_WindowsProductActivation&quot;)

   result = Obj.SetProductKey (VOL_PROD_KEY)

   if err &lt;&gt; 0 then
      WScript.Echo Err.Description, &quot;0x&quot; &amp; Hex(Err.Number)
      Err.Clear
   end if

Next</code></pre></div><p>подскажите, в чем моя ошибка.</p>]]></content>
			<author>
				<name><![CDATA[malegik]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27112</uri>
			</author>
			<updated>2011-07-26T10:14:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=50190#p50190</id>
		</entry>
</feed>
