How-To... - Find the locations of the Windows, System and Temporary Directories

DodgeSoft Productions - How To -- Locations....Because Microsoft gives you the option to install Windows in a different location rather than C:\Windows, using these Functions to find the location of the directories is a must. For example, if you want to write a file to the Windows directory and you use, for example, open "c:\windows\dodgesoft.ini" for ..................", and Windows has been installed to another location(e.g. C:\Win98), then your program will crash and the user will not want to, and may even not be able to use your program again.


There is three functions -- GetWindowsDirectory, GetSystemDirectory and GetTempPath. Each one does as you would believe them to - return their locations. The code has been documented to let you know what is going on.

Using these functions will make your program more efficient, and will make sure no errors will occur.

You can download the source code by clicking here


This site is Copyright © 1999 of David Cowan. VB How-To, Dodgesoft and DodgeSoft Productions is Copyright © 1999 of David Cowan. Source-code and programs are copyright of their respective owners. For a messageboard, click here