By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,373 Members | 1,763 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,373 IT Pros & Developers. It's quick & easy.

changing drive letter automatically

P: 13
Hello again, in my program i have it to search a certain path for files example:

Expand|Select|Wrap|Line Numbers
  1. f:\archive\files
is there a way that if the program gets installed on a different drive that the "f" will automatically be changed to the new drive letter. example:

the code is written like this
Expand|Select|Wrap|Line Numbers
  1. f:\archive\files
if i want to install the program on the "c" drive instead the line of code will automatically change to:
Expand|Select|Wrap|Line Numbers
  1. c:\archive\files
any help will be greatly appreciated
May 6 '08 #1
Share this Question
Share on Google+
1 Reply


KodeKrazy
P: 32
First: NOTHING is "Automatic" when programming. You have to define virtually everything, hence the name "Programming". <GRIN>

Second: Have you tried using the My.Computer.FileSystem object. It contains all of the functionality you will need to accomplish the task @ hand...

Alternatively, you could have the application set a registry key (it may already do this) containing the path to itself, and then just read the registry key and return the correct path. But there is nothing "automatic" about it. You have to define it.

KK
May 7 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.