473,386 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

GetFiles returns "Access to the path 'C:\System Volume Information' is denied."

I'm not sure why I'm getting this error when searching thru my local hard
drives using My.Computer.FileSystem.GetFiles?

I've got FileIOPermissions set in code:

Dim f As New FileIOPermission(PermissionState.Unrestricted)
f.AllFiles = FileIOPermissionAccess.AllAccess

But I still get this error? Any work arounds to this?

Rob.
Jun 21 '06 #1
6 12551
Addendum: This is a Windows Form app, not a web app.

"Rob R. Ainscough" <ro*****@pacbell.net> wrote in message
news:OM**************@TK2MSFTNGP05.phx.gbl...
I'm not sure why I'm getting this error when searching thru my local hard
drives using My.Computer.FileSystem.GetFiles?

I've got FileIOPermissions set in code:

Dim f As New FileIOPermission(PermissionState.Unrestricted)
f.AllFiles = FileIOPermissionAccess.AllAccess

But I still get this error? Any work arounds to this?

Rob.

Jun 21 '06 #2
Hello Rob,
Local Admins and Domain Admins can't even access this folder. I don't know
why *exactly*.. but that's just how it is.

-Boo
I'm not sure why I'm getting this error when searching thru my local
hard drives using My.Computer.FileSystem.GetFiles?

I've got FileIOPermissions set in code:

Dim f As New
FileIOPermission(PermissionState.Unrestricted)
f.AllFiles = FileIOPermissionAccess.AllAccess
But I still get this error? Any work arounds to this?

Rob.

Jun 21 '06 #3
I came up with a work-around, basically from the root use the GetDirectories
filter to search TopLevelOnly and check for System Volume Information, then
do a GetFiles on a "valid" dir.

As usual, the MSDN samples don't work as presented and NO documentation
(except on Feedback site) on this issue at all. So a 2 minute job ends up
being another R&D hunt wasting hours.
"GhostInAK" <gh*******@gmail.com> wrote in message
news:be*************************@news.microsoft.co m...
Hello Rob,
Local Admins and Domain Admins can't even access this folder. I don't
know why *exactly*.. but that's just how it is.

-Boo
I'm not sure why I'm getting this error when searching thru my local
hard drives using My.Computer.FileSystem.GetFiles?

I've got FileIOPermissions set in code:

Dim f As New
FileIOPermission(PermissionState.Unrestricted)
f.AllFiles = FileIOPermissionAccess.AllAccess
But I still get this error? Any work arounds to this?

Rob.


Jun 22 '06 #4
>Local Admins and Domain Admins can't even access this folder. I don't know
why *exactly*.. but that's just how it is.


Because the ACL on the folder are set so that only the local system
account have access to it by default.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jun 22 '06 #5
but I'm able to read the information just nothing below it -- the real issue
is a bug in the .NET routine -- it should be able to deal with the
situation -- just missing bounds checking which is primary cause of 80% of
software bugs -- sloppy code from M$ that is known, but has not been made a
priority because a work around exists.

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:eR**************@TK2MSFTNGP02.phx.gbl...
Local Admins and Domain Admins can't even access this folder. I don't
know
why *exactly*.. but that's just how it is.


Because the ACL on the folder are set so that only the local system
account have access to it by default.
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Jun 23 '06 #6
Hello Rob,

It's not a bug or sloppy M$ code. As Mattias said, the ACL doesnt allow
an interactive user to access that directory. You could easily mark any
directory/file to prevent certain users from accessing them.. In which case
your code would fail if run as one of those restricted users.

Wrap your code in a Try catch block.

-Boo
but I'm able to read the information just nothing below it -- the real
issue is a bug in the .NET routine -- it should be able to deal with
the situation -- just missing bounds checking which is primary cause
of 80% of software bugs -- sloppy code from M$ that is known, but has
not been made a priority because a work around exists.

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:eR**************@TK2MSFTNGP02.phx.gbl...
Local Admins and Domain Admins can't even access this folder. I
don't
know
why *exactly*.. but that's just how it is.

Because the ACL on the folder are set so that only the local system
account have access to it by default.

Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Jun 26 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Winterminute | last post by:
If I try to make any changes to the ASP.NET Portal Starter kit it fails with an access denied error. This was working when I left last week and is failing today. I don't remember changing...
6
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
1
by: VB Programmer | last post by:
When I run this line: Dim sw As New System.IO.StreamWriter(strFileName) I get this error: System.UnauthorizedAccessException: Access to the path...
0
by: zeyais | last post by:
I am using this control to implement AJAX in my application. http://ajax.schwarz-interactive.de/csharpsample/default.aspx The application uses windows authentication and does some file...
2
by: Lenn | last post by:
Hello, I am using reflections to get Parameters and their types of a COM Interop Assembly method. ParameterType.FullName returns "System.Boolean&" what's the significance of & at the end? ...
2
by: Dave | last post by:
Hi - I have an application that is monitoring a process on another machine. This application runs as a service. The error that I am getting when this runs is: Couldn't get process...
2
by: RodneyAnonymous | last post by:
Hello everyone. I'm working on a simple utility that lists all files in a given directory with a given extension and outputs the results to a text file. I'm encountering issues while testing where...
2
by: sphinney | last post by:
Hi everyone. I have a form in my Access 2007 database with a Microsoft Office Document Imaging Viewer Control 12.0 object on it. The object is named "GRAPHIC_mdv". When the form opens I want to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.