473,791 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Fil eSystem.GetFile s?

I've got FileIOPermissio ns set in code:

Dim f As New FileIOPermissio n(PermissionSta te.Unrestricted )
f.AllFiles = FileIOPermissio nAccess.AllAcce ss

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

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

"Rob R. Ainscough" <ro*****@pacbel l.net> wrote in message
news:OM******** ******@TK2MSFTN GP05.phx.gbl...
I'm not sure why I'm getting this error when searching thru my local hard
drives using My.Computer.Fil eSystem.GetFile s?

I've got FileIOPermissio ns set in code:

Dim f As New FileIOPermissio n(PermissionSta te.Unrestricted )
f.AllFiles = FileIOPermissio nAccess.AllAcce ss

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.Fil eSystem.GetFile s?

I've got FileIOPermissio ns set in code:

Dim f As New
FileIOPermissio n(PermissionSta te.Unrestricted )
f.AllFiles = FileIOPermissio nAccess.AllAcce ss
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*******@gmai l.com> wrote in message
news:be******** *************** **@news.microso ft.com...
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.Fil eSystem.GetFile s?

I've got FileIOPermissio ns set in code:

Dim f As New
FileIOPermissio n(PermissionSta te.Unrestricted )
f.AllFiles = FileIOPermissio nAccess.AllAcce ss
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.o rg> wrote in message
news:eR******** ******@TK2MSFTN GP02.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.o rg> wrote in message
news:eR******** ******@TK2MSFTN GP02.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
7050
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 anything, but I guess something had to be changed. I have checked NTFS permissions and the ASPNET account has full control on the parent directory of that XML file and on the file itself. I have also checked in IIS, and the Virtual Directory has...
6
4141
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 had to manually install all of the ODBC drivers and the rest of the DLL's, and now I am getting "Access is Denied" errors on any page that uses ADODB. How do I fix it? I already gave the ODBC drivers in the folders in "c:\program files\common...
0
3539
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 original question, the subject line is: ADODB.NET and "Access Denied" I have an ASP.NET page writtein in VB that uses ADODB. I just had to
1
5633
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 "c:\inetpub\wwwroot\MyWeb\Resources\Templates\MyPage.Html" is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
0
1188
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 operations (move copy etc using Robocopy). When I don't use AJAX it works like charm but when I do this using AJAX it returns Access denied. Any suggestions?
2
4077
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? Here's my code: /* Project1.Class1Class has 1 method doA, second param is boolean type */ //Get Type from Assebly Assembly asm = Assembly.Load("Interop.Project1");
2
2432
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 information from remote machine. System.ComponentModel.Win32Exception: Access is denied I have searched the web extensively to solve my problem, but have found
2
11655
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 the DirectoryInfo.GetFiles returns nothing. When I put a break in and check it out further, it looks like I'm getting ERROR_ACCESS_DENIED when the GetFiles hits certain directories (for example, a System Volume Information directory). If this were...
2
4825
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 take the path and filename information passed to the form (via the form's opening arguements) and display the file in the MODI Viewer Control object. I'm using the following code to do this: Private Sub Form_Open(Cancel As Integer) Dim miDOC As...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.