Solved

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

Posted on 2002-07-05
5
130 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
ID: 7131654
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]
ID: 7131655
Try this:
Environ("WINDIR")

CHeers
0
 
LVL 1

Author Comment

by:slavikn
ID: 7131665
Same answers, but TimCottee was first.
0
 
LVL 142

Expert Comment

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

Author Comment

by:slavikn
ID: 7131714
Hello angelIII,

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

823 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