<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: слежение за изменением ключа реестра]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=755&amp;type=atom" />
	<updated>2007-10-06T12:21:15Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=755</id>
		<entry>
			<title type="html"><![CDATA[VBScript: слежение за изменением ключа реестра]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=5364#p5364" />
			<content type="html"><![CDATA[<p>Автор идеи - <strong>Alexbootch</strong>.<br />Скрипт отслеживает изменение значения указанного ключа в реестре:<br /></p><div class="codebox"><pre><code>strComputer = &quot;.&quot; 
strHive = &quot;HKEY_LOCAL_MACHINE&quot;
strKeyPath = &quot;SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\&quot;
strValueName = &quot;Userinit&quot;
&#039;====================================================================
Set objWMIService = GetObject(&quot;winmgmts:\\&quot; &amp; strComputer &amp; &quot;\root\DEFAULT&quot;) 
Set objEvents = objWMIService.ExecNotificationQuery _
(&quot;SELECT * FROM RegistryValueChangeEvent WHERE &quot; &amp; _
    &quot;Hive = &#039;&quot; &amp; strHive &amp; &quot;&#039;&quot; &amp; _
    &quot; AND KeyPath = &#039;&quot; &amp; strKeyPath &amp; &quot;&#039;&quot; &amp; _
    &quot; AND ValueName = &#039;&quot; &amp; strValueName &amp; &quot;&#039;&quot;)

Do While(True)
    Set objReceivedEvent = objEvents.NextEvent
    Wscript.Echo Now &amp; &quot; изменён ключ: &quot; &amp; strHive &amp; &quot;\&quot; &amp; Replace(strKeyPath, &quot;\\&quot;, &quot;\&quot;) &amp; strValueName
Loop</code></pre></div>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2007-10-06T12:21:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=5364#p5364</id>
		</entry>
</feed>
