Link to home
Start Free TrialLog in
Avatar of RogueAce
RogueAce

asked on

Gaak...generic name for Windows directory

What is the code used to grab the name of the Windows directory and use it in my program?

Rogue
ASKER CERTIFIED SOLUTION
Avatar of Simon_Hendry
Simon_Hendry

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wsh2
wsh2

Or if you have VB6 and don't want to use API calls.. use the FSO.. <smile>

Add a Reference in your project (VB Menu.. Project.. References) to "Microsoft Scripting Runtime" ie. SCRRUN.DLL and then you can use the following.. <smile>.

<----- code begin ----->

Dim fso As New FileSystemObject
Dim strFolderName As String

strFolderName = fso.GetSpecialFolder(WindowsFolder)

MsgBox strFolderName

<----- Code End ----->

Short, sweet and 100% VB.
Avatar of RogueAce

ASKER

Thanks, you guys!