473,396 Members | 1,996 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,396 software developers and data experts.

How to determine the Operating System (95/98/XP)

xyz
I have a program that I need to update to work under Windows 95,
Windows 98, and Windows XP to display a help file.

Under Windows 95/98, I can use the following code:

fil = App.Path & "\file.hlp"
rc = Shell("winhelp " & fil, vbNormalFocus)

The above code does not work under Windows XP, so I have to use:

fil = App.Path & "\file.hlp"
Call ShellExecute(Me.hwnd, "open", fil, "", "", 0)

If there is a command that lets me know what operating system I am
running on, I will be able to put some conditional code?

Can somebody tell me how to do it?

Thank you,

xyz
Jul 17 '05 #1
2 4540
xyz
On Thu, 11 Sep 2003 22:11:27 GMT, xyz <xy*@mailinator.com> wrote:

Looking through the internet I found the answer to my own question:

I added a Microsoft SysInfo control on the form and this code:

If SysInfo1.OSPlatform = 2 Then
' OSPlatform = 2 for Win NT/2000/XP
Call ShellExecute(Me.hwnd, "open", fil, "", "", 0)
Else
' OSPlatform = 1 for Win 95/98
rc = Shell("winhelp " & fil, vbNormalFocus)
End If

Jul 17 '05 #2
see this article: "Obtaining Windows' Version Information" at
http://www.mvps.org/vbnet/
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nathan Sokalski | last post by:
I want to determine the operating system using ASP (or VBScript inside of ASP). I tried to get it using the Request. ServerVariables(EnvironmentVariable) method. On the web page about ASP in which...
3
by: lucpustjens | last post by:
Hello, I want te determine the client operating system, because I need to kno the default cookie directory. If there is a way to determine the cooki directory directly, than it is also good. ...
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
3
by: Sisyphus | last post by:
Hi, Is there anything in the ANSI C standard covering the means by which I can determine the operating system and compiler being used (at the preprocess stage) ? If so, then how might I...
12
by: Sunner Sun | last post by:
Hi, all Since the OS look both ASCII and binary file as a sequence of bytes, is there any way to determine the file type except to judge the extension? Thank you!
6
by: Kaki | last post by:
Given a file, how do I know if it's ascii or unicode or binary? And how do I know if it's rtf or html or etc? In other words, how do I find the stream type or mime type? (No, file extension cannot...
4
by: Alex Vincent | last post by:
HI all, I'm storing images, jpgs/gifs/png/bmps and also some other binary files in a SQL image field in a SQL 2k database. Most of the images enter the database via a asp.net webform upload,...
7
by: Ian F. Hood | last post by:
Hi In typically windows environments I have used: if 'Windows' in os.environ... to prove it, but now I need to properly support different environments. To do so I must accurately determine what...
4
by: Kenaso | last post by:
I know this has been asked before and I visited the VBNet website and ran the code to determine the operating system. My problem is I am running Windows Vista Home Edition. This code reports I am...
3
by: Giampaolo Rodola' | last post by:
Hi, I'd like to know if there's a way to determine which is the best buffer size to use when you have to send() and recv() some data over the network. I have an FTP server application which, on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.