Beginning VB 6For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Does anyone know how to determine which OS is being used? At the moment I am using sysinfo and it returns the same for 2000 and NT4, I presume that it looks at the file system or something...
This might not be the ideal way but normally I use:
Set oShell = CreateObject("Wscript.Shell")
arrRegValue = oShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Micros oft\Windows NT\CurrentVersion\ProductName")
This will read the productName value in the reg and depending on the value do whatever. Normally if u only running 2 OS versions you could only check for the common one then assume the rest would be the other.