473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

How to find out which operating system is the system on

Hi, i have a system done in VB6 i was wondering is there a way i can find out what operating system is being used. I need this for drive mapping. Would i need to use the file system object at all.

Thanks in advance
Nov 12 '07 #1
2 4196
debasisdas
8,127 Expert 4TB
select Project ---> Add Form
select About Dialog

On the new form you will get a button System Info and a lot of inbuilt code along with that.

Hope that solves your problem.
Nov 12 '07 #2
jamesd0142
469 256MB
Well in vb.net:

Expand|Select|Wrap|Line Numbers
  1. Public Function OS_Version() As String
  2.  
  3.         Dim osInfo As OperatingSystem
  4.         Dim sAns As String
  5.  
  6.         osInfo = System.Environment.OSVersion
  7.  
  8.         With osInfo
  9.             Select Case .Platform
  10.                 Case .Platform.Win32Windows
  11.                     Select Case (.Version.Minor)
  12.                         Case 0
  13.                             sAns = "Windows 95"
  14.                         Case 10
  15.                             If .Version.Revision.ToString() = "2222A" Then
  16.                                 sAns = "Windows 98 Second Edition"
  17.                             Else
  18.                                 sAns = "Windows 98"
  19.                             End If
  20.                         Case 90
  21.                             sAns = "Windows Me"
  22.                     End Select
  23.                 Case .Platform.Win32NT
  24.                     Select Case (.Version.Major)
  25.                         Case 3
  26.                             sAns = "Windows NT 3.51"
  27.                         Case 4
  28.                             sAns = "Windows NT 4.0"
  29.                         Case 5
  30.                             If .Version.Minor = 0 Then
  31.                                 sAns = "Windows 2000"
  32.                             ElseIf .Version.Minor = 1 Then
  33.                                 sAns = "Windows XP"
  34.                             ElseIf .Version.Minor = 2 Then
  35.                                 sAns = "Windows Server 2003"
  36.                             Else 'Future version maybe update
  37.                                 'as needed
  38.                                 sAns = "Unknown Windows Version"
  39.                             End If
  40.                     End Select
  41.  
  42.             End Select
  43.         End With
  44.  
  45.         Return sAns
  46.     End Function
  47. --------------------------------------------------
  48. USE:
  49.  Dim sAns As String
  50.         MsgBox(OS_Version())
  51. --------------------------------------------------
  52.  
example exe attached.
Unzip > change extension of txt file to ".exe"
Attached Files
File Type: zip Os Version.zip (6.8 KB, 214 views)
Nov 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Loi | last post by:
Hi All, I use Bulk insert to put data to myTable. When the SQL server is in local machin, it works well. But when I put the data in a sql server situated not locally, then I get a error message...
3
by: James | last post by:
How can i programicly find out what operating system i am using? i have tried using: getenv("OS"); it works works on xp/2000 but it doesn't seem to work on windows95/98/ME. im using ms visual...
27
by: Kevin A | last post by:
Hi, Is there a way to determine the name and version of the operating system in a portable way? (for Solaris/Linux) Thanks, Kevin
1
by: Tony Bansten | last post by:
Assume I have a partition (under WIn2000/WInXP) which is possibly NOT formatted with a files system (e.g. NTFS). This could be a partition on an external USB harddisc. How do I find out if this...
29
by: chellappa | last post by:
hi all I need to write a program to find mac address of a my computer using libaries, is this possible? How? thanks
1
by: Robert Robertson | last post by:
Hello Experts. I'm a H/W guy (not S/W) In a C++ code, I need to find/identify all calls that the program sends to the Operating System (Linux). What are the definitions, syntax etc... of such a...
16
by: sudhir | last post by:
hi how to check escape key is pressed when accepting the string as input. Because I do not want to receive a string if user presses the ESCAPE key.. I used ascii code for comparision but I...
15
by: David T. Ashley | last post by:
I'll be using gcc under Red Hat Enterprise Linux. Where do I find information about the low-level calls to the operating system from compiled 'C'? For example, if I want to cause a process to...
6
by: pavanip | last post by:
Hi, I have developed one windows application using vb.net. I have setup that application on windows operating system its working fine on windows os. Now I am trying to do that exe run on Mac...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.