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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows version for VISTA

Status
Not open for further replies.

Paul25441

Programmer
Mar 31, 2007
8
0
0
BE
Hello all,

I'm running now Windows Vista

In VFP9 I'm using ASC2BEINT2.prg from Richard G Bean to find the version Windows, is there an update for Windows Vista?

regards

Paul
 
Paul,

Rick's code was written for VFP 6.0. I feel sure that if he had updated it, he would have posted the update somewhere.

However, why not just use the OS() function? That should work with Vista just like any other operating system. I don't have Vista installed, so cannot tell you the value it will return. But if you have Vista, why not just try it and see.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,

The code is updated and returns 'Windows Vista'
os() returns Windows 6.0

regards,
Paul
 
If you know you are only running in XP / Vista, you can get additional information with winmgmts. (Some of this info is shown below.)
Code:
strComputer = "."
objWMIService = GetObject("winmgmts:"  ;
 + "{impersonationLevel=impersonate}!\\" + strComputer + "\root\cimv2")

colOSes = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOS in colOSes
  ? "Operating System"
  ? "  Caption: " + objOS.Caption &&Name
  ? "  Version: " + objOS.Version &&Version + build
  ? "  ServicePackMajorVersion: " + TRANSFORM(objOS.ServicePackMajorVersion) + "." ;
    + TRANSFORM(objOS.ServicePackMinorVersion)
endfor
Rick
 
Thank you Rick
It's working fine
regards
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top