Get Windows and System directories
By: Unknown Date: 24/09/1998
File:

getwindirs.zip

Size:

501 bytes

Download now!

Determine at run-time what the user's Windows and System directories are. Not all users have Windows neatly tucked away under a C:\Windows directory. What if they run two versions of Windows? Hard-coding C:\Windows into your programs to work with files in the Windows directory can be dangerous at best. This tip will show you how to instruct Windows itself to tell you exactly where it is (and it's System subdirectory as well).

Syntax

GetWinDir()
GetSysDir()

Parameters

N/A

Type of data

String

Returns

Directory path.

-

You can use the returned information for several things. Many software vendors maintain their INI files in the Windows directory as opposed to the application's directory. You may need to activate Windows applets or handle application installation routines. Whatever the need is, you no longer have to assume that the user's Windows directory is in the same place as yours!

The functions are contained in a module. You can cut and paste it in any program of yours.

Click Here!


Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
Webmaster's e-mail: webmaster@vbprogzone.cjb.net
Hosted by InWind: www.inwind.it