http://msdn.microsoft.com/library/de...tingSystem.asp
----
using System;
using System.Management;
using System.Windows.Forms;
namespace WMISample
{
public class MyWMIQuery
{
public static void Main()
{
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_OperatingSystem");
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("-----------------------------------");
Console.WriteLine("Win32_OperatingSystem
instance");
Console.WriteLine("-----------------------------------");
Console.WriteLine("Version: {0}",
queryObj["Version"]);
}
}
catch (ManagementException e)
{
MessageBox.Show("An error occurred while querying for
WMI data: " + e.Message);
}
}
}
}
On Sep 4, 11:51 am, "Claire" <c...@nospam.comwrote:
I need to read data from one of two file locations depending on whether the
application is hosted on Vista or an older version of windows. On older
systems its on a subdirectory of the application, on Vista on
commonapplicationdata.
How do I query windows version please?
thank you
Claire