How do I access the root drive on Vista?

I have a .NET app that links to and mdb C:\Program Files\Appname\db using the line:
Dim folder As String = "C:\program Files\Celebrant Assist\db\"  etc.
I'm using a multi boot XP/Vista machine.  Vista is installed on Drive F .  For that and other Vista reasons I need to be able to address program Files, where it is  eg.
%root folder%\Program Files\Appname\db
Can anyone tell me if this will work, or what it should be.
Thanks in advance,

CRB1609Access DeveloperAsked:
Who is Participating?
 
LeeTutorConnect With a Mentor retiredCommented:
Unfortunately, among the changes from XP and previous OS's that Vista has brought in is the new prohibition on programs storing data in subfolders of the Program Files folder.  In order to be able to work in legacy programs that do such things, there is the new concept of file and folder virtualization.  There is a like concept that restricts access to the registry, so there is registry virtualization also.  I understand these are "stopgap" measures which may be modified in future MS releases.  See these pages:

http://juice.altiris.com/article/2665/folder-virtualization-concepts-windows-vista

http://windowsconnected.com/blogs/jerry/archive/2005/12/19/86.aspx
File and Registry Virtualization – the good, the bad, and the ugly
0
 
Netman66Connect With a Mentor Commented:
I think the variable you are looking for is %systemdrive%.

So, "%systemdrive%\Program Files" should get you there.
0
 
LeeTutorretiredCommented:
CRB1609, any feedback?
0
 
CRB1609Access DeveloperAuthor Commented:
Hi,
Sorry about the delay in feedback.  It has been a nightmare.  The variable doesn't make any difference.  Same result as using C:\Program Files\etc...  but then the app doesn't get to run.  I think it is something to do with not being able to find the application MDW.  I'm leaving the question open while I do more testing.
CRB
0
 
CRB1609Access DeveloperAuthor Commented:
Very, very sorry for leaving this so long.  Thanks for your help.
0
All Courses

From novice to tech pro — start learning today.