pls help - how to read from qb4.5 the version number of the OS 
Author Message
 pls help - how to read from qb4.5 the version number of the OS

Pls help , I need to be able to read the version number of the OS of
DOS, win 3.xxx, win 95 , and win98 directly in qb4.5 rather than go to
dos mode and type ver.

any assistance , appreciated and thanks in advance.

Alan



Tue, 17 Oct 2000 03:00:00 GMT  
 pls help - how to read from qb4.5 the version number of the OS

Quote:
>Pls help , I need to be able to read the version number of the OS of
>DOS, win 3.xxx, win 95 , and win98 directly in qb4.5 rather than go to
>dos mode and type ver.

Greetings,

 I do believe I have a file of that sort of my web page, located at
http://members.aol.com/constractr   under the PROGRAMMING section.  If I dont,
It will be posted as soon as i update the page!

REgards,

http://members.aol.com/constractr -- PROGRAMMING FILES!



Tue, 17 Oct 2000 03:00:00 GMT  
 pls help - how to read from qb4.5 the version number of the OS

Quote:
> Pls help , I need to be able to read the version number of the OS of
> DOS, win 3.xxx, win 95 , and win98 directly in qb4.5 rather than go to
> dos mode and type ver.

        This will get the version number for DOS:

                DIM register AS RegTypeX
                register.ax = &H30
                CALL InterruptX(&H21, register, register)
                MajorVer = register.ax \ 256
                MinorVer = register.ax MOD 256

So for DOS 6.22, you'd get MajorVer = 6 and MinorVer=22.  Of course, when
Windows is running, the OS is still DOS, so this function will still
report the DOS version.  For Win95, I believe it will report version 7.0
or 7.1.  I don't know if the DOS version will be changed when Win98
comes out.

        If you need to know the version of Windows that's running, you'll
need some other interrupt.  I haven't used this, but I found a note about
the Win 3.x version number suggesting that this should work:

                register.ax = &H160A
                CALL InterruptX(&H2F, register, register)
                MajorVer = register.bx \ 256
                MinorVer = register.bx MOD 256

I have no idea about Win95, but you can probably find this info (as well
as double-checking the above) in Ralf Brown's interrupt list.

Jon Visick



Tue, 17 Oct 2000 03:00:00 GMT  
 pls help - how to read from qb4.5 the version number of the OS

Here is source code to get the DOS version number. Remember to load the
QB.LIB library when starting QB45 as it contains the Interrupt subroutine
needed for this.
i.e. C:\QB /L QB.LIB   (I think it's QB.LIB)

'// This TYPE includes the registers needed for the interrupt call //
TYPE REGTMP
  AX AS INTEGER
  BX AS INTEGER
END TYPE
DIM Regs AS REGTMP

'// GetDosVersion: Input - AH = 30h //
'//                              Interrupt &H21   //

Regs.AX = &H30 * 256       '// Multiplying by 256 shifts &H30 into AH part
of AX //

CALL Interrupt(&H21, Regs, Regs)

Major% = Regs.AX MOD 256      '// Get Major DOS number from AL //
Minor% = Regs.AX \ 256              '// Get Minor DOS number from AH //

CLS
PRINT "DOS Version number "; Major%; "."; Minor%

Hope this is what you are looking for.



Tue, 17 Oct 2000 03:00:00 GMT  
 pls help - how to read from qb4.5 the version number of the OS

Quote:

>Pls help , I need to be able to read the version number of the OS of
>DOS, win 3.xxx, win 95 , and win98 directly in qb4.5 rather than go to
>dos mode and type ver.

>any assistance , appreciated and thanks in advance.

>Alan

In the PBClone libraries you can find such routines.


Thu, 19 Oct 2000 03:00:00 GMT  
 pls help - how to read from qb4.5 the version number of the OS

As suggested, routines in libraries is probably the way to go. But this
would also work :

  SHELL "VER > DIRINFO.VER"  
  OPEN "DIRINFO.VER" FOR INPUT AS #1
  LINE INPUT #1, Record$
  LINE INPUT #1, Record$
  CLOSE #1                    
  KILL "DIRINFO.VER"    

  PRINT "Operating System :"; " "; Record$
--
Costas

Email : If you wish to reply directly, please decode address first



|
| >
| >Pls help , I need to be able to read the version number of the OS of
| >DOS, win 3.xxx, win 95 , and win98 directly in qb4.5 rather than go to
| >dos mode and type ver.
| >
| >any assistance , appreciated and thanks in advance.
| >
| >Alan
| In the PBClone libraries you can find such routines.
|
|



Sat, 21 Oct 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. OS Version Number

2. How to read the disk serial number and OS version number?

3. In need of help (Using QB4.5) - READ!

4. HELP! - Reading Btrieve Data in QB4.5

5. Reading the Version Number of a System File

6. how to read version number at runtime?

7. reading program version number

8. Reading Version Number of DLL

9. Pls help me on how to combine this number

10. Pls Help: Limit On Number Of Controls

11. Need Help!!Pls read on...

12. Diff between Pocket PC OS / Handled PC OS/ Embedded NT OS

 

 
Powered by phpBB® Forum Software