From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f890526de6a8a218 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How to detect OS type and version? From: Bernd.Specht@gmx.com (Bernd Specht) References: <87u0flf93a.fsf@code-hal.de> Organization: No company Message-ID: User-Agent: Xnews/4.05.03 Date: 13 Oct 2005 20:41:47 GMT NNTP-Posting-Date: 13 Oct 2005 22:41:47 MEST NNTP-Posting-Host: 123bfda1.newsread4.arcor-online.net X-Trace: DXC=LFS1na4BP[mmBTbc_2cXMb:ejgIfPPlddjW\KbG]kaMhea\9g\;7Nme6fiV[l38A\fWEh14DWb8Dh:09DHHn9m>lPGf8QL@l`bi X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:5611 Date: 2005-10-13T22:41:47+02:00 List-Id: Michael Bode wrote in news:87u0flf93a.fsf@code-hal.de: > Bernd.Specht@gmx.com (Bernd Specht) writes: > >> If you cannot determine a linux system as described above, then try to >> open a file that is typically for windows (e.g. >> "c:\winnt\system32\command.com"). If you get _no_ exception, then you >> are on a windows system. To find the version, look for the file >> "prodspec.ini" (in c:\winnt\system32 and in c: \system32). You can >> find the Window type (2000, XP) and the build number. But - not on all >> Windows systems :-( (Win98 do not have this file). > > It has not to be "c:\winnt". The correct path is "%Systemroot%" and > for that you must read the environment variable. > But as he doesn't know the os, he cannot read an environment variable. Personally I've never seen a Windows system on a different drive (older versions of Windows required C: which often gave problems with OS/2 on same drive). Beside this you can try C:, D: ...