Connecting Tech Pros Worldwide Help | Site Map

changing drive letter automatically

Newbie
 
Join Date: Feb 2008
Location: Minnesota
Posts: 13
#1: May 6 '08
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
KodeKrazy's Avatar
Member
 
Join Date: Mar 2008
Location: West Palm Beach
Posts: 32
#2: May 7 '08

re: changing drive letter automatically


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
Reply


Similar Visual Basic 4 / 5 / 6 bytes