我一直使用Win32::GetOSVersion() Perl函数来获取目标操作系统版本。然而,这个API调用只支持Windows Server 2012及以下版本。
http://search.cpan.org/~jdb/Win32-0.52/Win32.pm
OS ID MAJOR MINOR
---------- --- ----- -----
Win32s 0 - -
Windows 95 1 4 0
Windows 98 1 4 10
Windows Me 1 4 90
Windows NT 3.51 2 3 51
Windows NT 4 2 4 0
Windows 2000 2 5 0
Windows XP 2 5 1
Windows Server 2003 2 5 2
Windows Server 2003 R2 2 5 2
Windows Home Server 2 5 2
Windows Vista 2 6 0
Windows Server 2008 2 6 0
Windows 7 2 6 1
Windows Server 2008 R2 2 6 1
Windows 8 2 6 2
Windows Server 2012 2 6 2
有没有其他方法或途径可以在Windows 10上获取操作系统版本?