<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; WSH: определение даты установки операционной системы]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9&amp;type=atom" />
	<updated>2013-11-10T16:01:29Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=9</id>
		<entry>
			<title type="html"><![CDATA[Re: WSH: определение даты установки операционной системы]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=77125#p77125" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>...
new Date(raw * 1000)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Rumata]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24846</uri>
			</author>
			<updated>2013-11-10T16:01:29Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=77125#p77125</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: WSH: определение даты установки операционной системы]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=77118#p77118" />
			<content type="html"><![CDATA[<p>Альтернативный вариант:<br /></p><div class="codebox"><pre><code>with (new ActiveXObject(&#039;WScript.Shell&#039;)) {
  var raw = RegRead(&#039;HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\InstallDate&#039;);
  with (new Date(1970, 0, 1)) {
    WScript.echo(new Date(setSeconds(getSeconds() + raw)));
  }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2013-11-10T09:04:47Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=77118#p77118</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[WSH: определение даты установки операционной системы]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=19#p19" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Set dtmConvertedDate = CreateObject(&quot;WbemScripting.SWbemDateTime&quot;)
strComputer = &quot;CompName&quot;
Set objWMIService = GetObject(&quot;winmgmts:&quot; _
    &amp; &quot;{impersonationLevel=impersonate}!\\&quot; &amp; strComputer &amp; &quot;\root\cimv2&quot;)
Set colOperatingSystems = objWMIService.ExecQuery _
    (&quot;Select * from Win32_OperatingSystem&quot;)
For Each objOperatingSystem in colOperatingSystems
    dtmConvertedDate.Value = objOperatingSystem.InstallDate 
    dtmInstallDate = dtmConvertedDate.GetVarDate
    Wscript.Echo &quot;Install Date: &quot; &amp; dtmInstallDate
Next</code></pre></div><p>Данный скрипт можно считать дополнением к статье <a href="http://www.script-coding.com/WMI_SoftWare.html">Рецепты WMI: сбор сведений о конфигурации операционной системы и установленном программном обеспечении</a>. Объект &quot;WbemScripting.SWbemDateTime&quot; применяется для приведения даты в удобочитаемый вид.<br />P.S. Скрипт прислал <strong>MoonRabbit</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2006-07-07T15:25:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=19#p19</id>
		</entry>
</feed>
