Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Windows version

Status
Not open for further replies.

chpicker

Programmer
Apr 10, 2001
1,316
I could have sworn I'd seen a question like this before, but I just can't seem to find it anywhere. How can you find out what version of Windows your app is running under? Our organization uses many computers with almost a different OS on each: Windows 98, NT 4.0, 2000, and XP. Wasn't there a command you could use to determind which one you're in?

I came up with this, but it's very clunky. I don't like using the RUN command if I can possibly avoid it:
[tt]
RUN ver > c:\version.out
cVersion = FILETOSTR("c:\version.out")
[/tt]
Strangely enough, running this command in Windows 2000, you end up with this string, which isn't what I expected:
[tt]
MS-DOS Version 5.00.500
[/tt]
Any suggestions? Is there a FoxPro command that can do this? An API function perhaps? I'm running VFP 6.0 SP5.

Ian
 
Ian,
The simple answer is my code at - Cindy posted it for me and Sergey killed most of my comments! <g>

Note: This actually started as an idea by Rick Strahl - not much original thinking going on here!

I've also got a much bigger API routine that picks off the Service Pack info and can even distingush between XP Home and Pro.

Rick
 
Windows XP home returns 'Windows 5.01'
Windows Me returns 'Windows 4.90'

Don't know any others off hand.

HTH Regards

Griff
Keep [Smile]ing
 
Ian,
I posted my &quot;longer&quot; API routine in the FAQ area - faq184-2695.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top