 | OO-Snippets: Get Windows VersionCommons| Keywords | windows version, get version |
|---|
| Language | OOBasic |
|---|
| Application | Office |
|---|
| Authors | Dorange-Pattoret Didier (initial)
|
|---|
| Supported Versions | |
|---|
| Supported OS | |
|---|
| Question |
How do I get the Windows Version?
|
|---|
| Answer |
You have to read the version information from the windows registry
|
|---|
Public Const HKEY_LOCAL_MACHINE = &H80000002
Sub VersionValue
Dim sVersion as String
Globalscope.BasicLibraries.LoadLibrary("ImportWizard")
OpenRegKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\")
sVersion = _ QueryValue(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\","ProductName")
If sVersion <> "" Then
Print sVersion
Else
OpenRegKey(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows_ NT\\CurrentVersion\\")
sVersion = QueryValue(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows_ NT\\CurrentVersion","ProductName")
Print sVersion
EndIf
End Sub
|
Changelog| Date | User | Modification |
|---|
| 0000-00-00 | ddp | Initial version |
|