|
-
Jan 17th, 2001, 04:27 AM
#1
Thread Starter
Evil Genius
Which function can I look up which can tell me what operating system the user is running on their PC.
Thank you in advance!
-
Jan 17th, 2001, 04:40 AM
#2
Fanatic Member
Code:
'paste into a form with 1 command button
Private Declare Function GetVersionExA Lib "kernel32" (lpVersionInformation As OSVERSIONINFO) As Integer
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Public Function getVersion() As Long
Dim osinfo As OSVERSIONINFO
Dim retvalue As Integer
osinfo.dwOSVersionInfoSize = 148
osinfo.szCSDVersion = Space$(128)
retvalue = GetVersionExA(osinfo)
getVersion = osinfo.dwPlatformId
End Function
Private Sub Command1_Click()
Dim lVersion&
lVersion = getVersion()
Select Case lVersion
Case 1
MsgBox "WIN9X"
Case 2
MsgBox "WINNT"
End Select
End Sub
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Jan 17th, 2001, 05:09 AM
#3
Thread Starter
Evil Genius
Cheers Crispin! 
What would happen if the user has windows 200, will this show up as NT? If so is there any way to tell the difference please?
Thanks again!
-
Jan 17th, 2001, 05:34 AM
#4
Fanatic Member
Yeah I just tested it on W2000Pro, it shows up as WINNT - dunno if thats much use or not really, there might be some more info in that OSVERSION struct that could tell you if its NT or W2000...
hope this helps
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Jan 17th, 2001, 05:39 AM
#5
Thread Starter
Evil Genius
No, that's excellent, at least I know cheers.
I am writing a setup program & will just use the fso.folderexists() to see if the start menu is under the Win2000\documents and settings\, or under NT\winnt\.
Thanks for your help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|