Reliable OS version detecting

Post Reply
User avatar
codemaker
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Reliable OS version detecting

Post by codemaker »

I need to precise detect the OS on which my app is running. The reason is complicated but basically I have a DLL which creates and manages the PDF files. This DLL works perfect on all Windows OS, except on Windows Server 2012 (Don't know about future Windows versions)
Works on all versions from XP to Windows 7, Windows 8, Windows Servers 2003, 2008.
Only Windows Server 2012 hangs the program when trying to access that DLL functions.

I need to detect the Windows Server 2012 OS and avoid calling this DLL and do some other PDF management is such case.

I was also thinking if there is some very specific file somewhere in Windows folder, which is solely related to Windows Server 2012 OS, maybe I can detect such file and then know that the machine runs Windows Server 2012?

Thanks
ADutheil
Posts: 352
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Reliable OS version detecting

Post by ADutheil »

I don´t know if its available under Windows Server 2012 but most Windows version I ran had the ver command that returns the current version. It can be redirected to file and easily treated.
Regards,

André Dutheil
FWH 13.04 HB 3.2 BCC 5.82 MinGW 4.5.2 MSVS 10
User avatar
codemaker
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: Reliable OS version detecting

Post by codemaker »

Yes, I was thinking about that but cannot confirm the reliability of the numbers yielded in VER command.
In any case, I solved the problem in different way. After I confirm the OS, I have a small file on some folder if the OS is 2012, which I check and according to that, decide to use the library or not.
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Reliable OS version detecting

Post by cnavarro »

Have you tried the function?

Code: Select all

? "Version S.O.: "+ Os()
 
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Post Reply