Get OS Information - Windows XP vs. Windows 7

38 views
Skip to first unread message

Alex Greber

unread,
Sep 22, 2011, 4:31:52 AM9/22/11
to va-sma...@googlegroups.com
"System osSystem" answers 'WIN32_NT' on both OS Windows XP vs. Windows 7.
Any suggestions?
Regards .. Alex
 

John O'Keefe

unread,
Sep 22, 2011, 4:58:19 AM9/22/11
to va-sma...@googlegroups.com
Alex -
 
Did you mean System osType?  You can find the specific version of Windows using System osVersion (for example, this answers '5.1 build 2600 Service Pack 3' on WinXP).
 
John

Narender Sharma

unread,
Sep 22, 2011, 5:32:25 AM9/22/11
to va-sma...@googlegroups.com
In Java
System.getProperty( "os.name") gives "Windows XP"
and System.getProperty( "os.version") gives "5.1"

I think we can achieve the same in smalltalk. One of the way could be to read from registry (but then registry can always be tweaked).

Thanks!


Alex Greber

unread,
Sep 22, 2011, 5:56:51 AM9/22/11
to va-sma...@googlegroups.com
Hoi John.
 
Yes I meant "System osType"
 
So Looking at the first 3 characters of String "System osVersion" is the solution.
 
Operating system Version number
Windows 7 6.1
Windows Server 2008 R2 6.1
Windows Server 2008 6.0
Windows Vista 6.0
Windows Server 2003 R2 5.2
Windows Server 2003 5.2
Windows XP 64-Bit Edition 5.2
Windows XP 5.1
Windows 2000 5.0
 
 
Thanks! Alex
 
 

Narender Sharma

unread,
Sep 22, 2011, 6:23:09 AM9/22/11
to va-sma...@googlegroups.com
This is valuable information. Thanks for sharing it.

Narender Sharma

unread,
Sep 22, 2011, 6:29:20 AM9/22/11
to va-sma...@googlegroups.com
One thing that is problematic with version numbers is that they are not unique for different OS...


Operating system

Version number
Windows 7 6.1
Windows Server 2008 R2 6.1
Windows Server 2008 6.0
Windows Vista 6.0
Windows Server 2003 R2 5.2
Windows Server 2003 5.2
Windows XP 64-Bit Edition 5.2

Thanks!
Reply all
Reply to author
Forward
0 new messages