I need to determine whether a machine is running Windows 7 Pro, or Windows 7 Embedded. Environment.OSVersion returns the same version number on both systems, as does the Windows Management Interface. I'm looking at the Registry for some form of identifier, but I'm wondering if there is a solution I haven't considered yet.
Asked
Active
Viewed 73 times
0
-
You can use WMI with [Win32_OperatingSystem](https://learn.microsoft.com/en-us/windows/desktop/CIMWin32Prov/win32-operatingsystem) (seeOSProductSuite, SuiteMask and/or ProductSKU) or call [`GetVersionEx`](https://learn.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getversionexw) as long as you don't need to worry about Windows 8.1 or above. – NetMage May 01 '19 at 18:27
-
Also see [Detect Windows version in .net](https://stackoverflow.com/q/2819934/1364007). – Wai Ha Lee May 01 '19 at 18:29
1 Answers
-1
Run the above code to get the OS details:
using System;
public class Example
{
public static void Main()
{
var os = Environment.OSVersion;
Console.WriteLine("Current OS Information:\n");
Console.WriteLine("Platform: {0:G}", os.Platform);
Console.WriteLine("Version String: {0}", os.VersionString);
Console.WriteLine("Version Information:");
Console.WriteLine(" Major: {0}", os.Version.Major);
Console.WriteLine(" Minor: {0}", os.Version.Minor);
Console.WriteLine("Service Pack: '{0}'", os.ServicePack);
Console.ReadKey();
}
}

Abhay Agarwal
- 93
- 1
- 9
-
Unfortunately that doesn't work for what I need. Both Windows 7 Pro and Windows 7 Embedded return the same value: Win32NT, NT 6.1.7601 SP 1. – Tylor Emmett May 02 '19 at 19:18
-
Try this By changing the language of your machine. https://www.askvg.com/fix-something-happened-error-message-in-windows-10-upgrade/ – Abhay Agarwal May 03 '19 at 05:12