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

OSType for XP comes back WindowsNT! (??)

Status
Not open for further replies.

eltrigo

Programmer
Oct 18, 2005
2
US
Hi, first post, please be kind :)

I use GetEnvironment to find out the OSType on the user's pc. Depending on what comes back, I set a path to the .ini I use for my app. The .ini is kept in the Windows folder.

We haven't run into any problems for years until now. For WinXP, the OSType comes back "WindowsNT!", for which I will set my path to "C:\WINNT"... which is wrong since XP's windows folder is actually "C:\Windows".

Has anyone seen this before and/or know of a workaround to determine between WinNT and WinXP for this matter?

Thanks.
 
You should be able to use the function

Function uint GetSystemDirectory (ref string lpBuffer, uint uSize) Library "KERNEL32.DLL" Alias for "GetSystemDirectoryA"

OR

Function uint GetWindowsDirectory (ref string lpBuffer, uint uSize) Library "KERNEL32.DLL" Alias for "GetWindowsDirectoryA"

to get the system and windows directory respectively. Do you think that will help?

-PBPro
 
You may be able to use some other check as a work around, such as checking to see if directories or files specific to Win XP exist or other Win XP specific things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top