Solved

Getting Windows path (for example: "c:\windows")

Posted on 2002-07-05
5
128 Views
Last Modified: 2010-05-02
How can I get it ("d:\winnt", for exmaple)?
0
Comment
Question by:slavikn
  • 2
  • 2
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 20 total points
Comment Utility
Many different ways in fact:

Debug.Print environ("Systemroot")

Is the easiest but you can also use the .SpecialFolders property of the wshShell object (if you have IE installed with the scripting runtime) or access it from the registry using registry classes.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
Try this:
Environ("WINDIR")

CHeers
0
 
LVL 1

Author Comment

by:slavikn
Comment Utility
Same answers, but TimCottee was first.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
Same minute :-)
Glad we could help!!
0
 
LVL 1

Author Comment

by:slavikn
Comment Utility
Hello angelIII,

Please post any comment here:
http://www.experts-exchange.com/visualbasic/Q_20319886.html
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now