<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Detect Windows Version with VB Script</title>
	<atom:link href="http://asadsiddiqi.wordpress.com/2008/05/13/detect-windows-version-with-vb-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://asadsiddiqi.wordpress.com/2008/05/13/detect-windows-version-with-vb-script/</link>
	<description>The techie in me ;) My routine junk stuff is all here</description>
	<lastBuildDate>Tue, 22 Dec 2009 00:04:17 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alexey</title>
		<link>http://asadsiddiqi.wordpress.com/2008/05/13/detect-windows-version-with-vb-script/#comment-535</link>
		<dc:creator>Alexey</dc:creator>
		<pubDate>Wed, 20 May 2009 15:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://asadsiddiqi.wordpress.com/?p=70#comment-535</guid>
		<description>Thanks for idea! I have decided to use it for that definition that at me OS has version Windows XP SP2 or above. Here so has copied on javascript:

var _fso = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
var _shell = new ActiveXObject(&quot;WScript.Shell&quot;);

WScript.Echo(IsWindowsXPSP2OrAbove() ? &quot;Yes&quot; : &quot;No&quot;);

function IsWindowsXPSP2OrAbove()
{
	var fileName = _shell.ExpandEnvironmentStrings(&quot;%USERPROFILE%&quot;) + &quot;\\Local Settings\\Temp\\winversion.txt&quot;;
	ExecCmd(&quot;ver &gt; \&quot;&quot; + fileName + &quot;\&quot;&quot;);

	var fileReader = _fso.OpenTextFile(fileName, 1, true);
	var str;
	var isXP = false;

	while (!fileReader.AtEndOfStream)
	{
		str = fileReader.ReadLine();
		if (str == &quot;&quot;)
			continue;
			
		var res = str.match(/\s(\d+\.\d+).\d+]$/)[1];
		if (res &gt;= &quot;05.1&quot;)
			isXP = true;
			
		break;
	}
	fileReader.Close();

	if (_fso.FileExists(fileName))
		_fso.DeleteFile(fileName);
		
	return isXP;
}
 
function ExecCmd(cmdLine)
{
	if (_shell.Run(&quot;cmd /c \&quot;&quot; + cmdLine + &quot;\&quot;&quot;, 1, true) == 0)
		return true;
	
	return false;
}</description>
		<content:encoded><![CDATA[<p>Thanks for idea! I have decided to use it for that definition that at me OS has version Windows XP SP2 or above. Here so has copied on javascript:</p>
<p>var _fso = new ActiveXObject(&#8220;Scripting.FileSystemObject&#8221;);<br />
var _shell = new ActiveXObject(&#8220;WScript.Shell&#8221;);</p>
<p>WScript.Echo(IsWindowsXPSP2OrAbove() ? &#8220;Yes&#8221; : &#8220;No&#8221;);</p>
<p>function IsWindowsXPSP2OrAbove()<br />
{<br />
	var fileName = _shell.ExpandEnvironmentStrings(&#8220;%USERPROFILE%&#8221;) + &#8220;\\Local Settings\\Temp\\winversion.txt&#8221;;<br />
	ExecCmd(&#8220;ver &gt; \&#8221;" + fileName + &#8220;\&#8221;");</p>
<p>	var fileReader = _fso.OpenTextFile(fileName, 1, true);<br />
	var str;<br />
	var isXP = false;</p>
<p>	while (!fileReader.AtEndOfStream)<br />
	{<br />
		str = fileReader.ReadLine();<br />
		if (str == &#8220;&#8221;)<br />
			continue;</p>
<p>		var res = str.match(/\s(\d+\.\d+).\d+]$/)[1];<br />
		if (res &gt;= &#8220;05.1&#8243;)<br />
			isXP = true;</p>
<p>		break;<br />
	}<br />
	fileReader.Close();</p>
<p>	if (_fso.FileExists(fileName))<br />
		_fso.DeleteFile(fileName);</p>
<p>	return isXP;<br />
}</p>
<p>function ExecCmd(cmdLine)<br />
{<br />
	if (_shell.Run(&#8220;cmd /c \&#8221;" + cmdLine + &#8220;\&#8221;", 1, true) == 0)<br />
		return true;</p>
<p>	return false;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: asadsiddiqi</title>
		<link>http://asadsiddiqi.wordpress.com/2008/05/13/detect-windows-version-with-vb-script/#comment-492</link>
		<dc:creator>asadsiddiqi</dc:creator>
		<pubDate>Fri, 20 Feb 2009 14:03:11 +0000</pubDate>
		<guid isPermaLink="false">http://asadsiddiqi.wordpress.com/?p=70#comment-492</guid>
		<description>Dude,
I know that this might be the most crappy way. Please understand that certain times you have to integrate some shit with an existing legacy application &quot;where things are done a certain way&quot; As far as OS goes the regiestry hierarchy is different for NT based systems too but thats not the point. The point is to detect it with VB Script&quot; ....
Appreciate your comment though. I hope it helps some1 stuck sometime trying to figure it out with vbs. 
Take care</description>
		<content:encoded><![CDATA[<p>Dude,<br />
I know that this might be the most crappy way. Please understand that certain times you have to integrate some shit with an existing legacy application &#8220;where things are done a certain way&#8221; As far as OS goes the regiestry hierarchy is different for NT based systems too but thats not the point. The point is to detect it with VB Script&#8221; &#8230;.<br />
Appreciate your comment though. I hope it helps some1 stuck sometime trying to figure it out with vbs.<br />
Take care</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 0xdeadc0de</title>
		<link>http://asadsiddiqi.wordpress.com/2008/05/13/detect-windows-version-with-vb-script/#comment-491</link>
		<dc:creator>0xdeadc0de</dc:creator>
		<pubDate>Fri, 20 Feb 2009 10:38:05 +0000</pubDate>
		<guid isPermaLink="false">http://asadsiddiqi.wordpress.com/?p=70#comment-491</guid>
		<description>That piece of code deserves a place in Daily WTF.

Have you heard of registry ? Have you heard of WMI ? You have tons of right ways to get the information needed and you choose the worse of them.

kkthxb</description>
		<content:encoded><![CDATA[<p>That piece of code deserves a place in Daily WTF.</p>
<p>Have you heard of registry ? Have you heard of WMI ? You have tons of right ways to get the information needed and you choose the worse of them.</p>
<p>kkthxb</p>
]]></content:encoded>
	</item>
</channel>
</rss>
