Solved

How do I access the root drive on Vista?

Posted on 2007-11-20
6
1,462 Views
Last Modified: 2013-12-25
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,

0
Comment
Question by:CRB1609
  • 2
  • 2
6 Comments
 
LVL 59

Accepted Solution

by:
LeeTutor earned 400 total points
Comment Utility
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
 
LVL 51

Assisted Solution

by:Netman66
Netman66 earned 100 total points
Comment Utility
I think the variable you are looking for is %systemdrive%.

So, "%systemdrive%\Program Files" should get you there.
0
 
LVL 59

Expert Comment

by:LeeTutor
Comment Utility
CRB1609, any feedback?
0
 

Author Comment

by:CRB1609
Comment Utility
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
 

Author Closing Comment

by:CRB1609
Comment Utility
Very, very sorry for leaving this so long.  Thanks for your help.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now