Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Directories with out knowing drive letter 1

Status
Not open for further replies.

one4thumb

Technical User
Jun 13, 2006
33
US
I am write a program that will reside on an External USB drive that I may use on different computers. Each Computer of course will give the drive a different letter.

I want to be able to access certain directories on the drive from with-in the program. Is their a way that I can access the directories with out knowing the drive letter.

For example I want to access the H:\This Folder directory with out having to use the H:. This will all will be hard coded.
 
Try this...

MsgBox Split(App.Path, "\")(0)

App.path will show you the drive and folder where the executable is located, by splitting on the back slash and taking the first element, you'll know the drive from which your application is running.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top