Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings' is denied. #9

Open
kangarko opened this issue Jun 8, 2023 · 6 comments

Comments

@kangarko
Copy link

kangarko commented Jun 8, 2023

Please make it possible to scan the entire disk such as C:\ because right now it gets stuck on accessing protected folders, can you just make it skip those folders?

a

@kangarko
Copy link
Author

kangarko commented Jun 8, 2023

Same if I selectivelly pick a folder containing protected folders:

a

@ketrab2004
Copy link

This should be fixed when #4 is merged

@PhattyOgre
Copy link

Seems that 1.0.1 has less rights than 1.0.0 did. With 1.0.0 I was able to scan locations like 'Program Files' and likewise x86 folder. Using 1.0.1 leaves me now unable to scan these locations. Seems that introduced code in the updated version leaves it unable to scan certain locations.

Using elevated permissions changes this to allow it to scan these locations that 1.0.0 used to scan just fine. But, as was the same case with 1.0.0, elevated permissions in version 1.0.1 is still unable to scan protected Windows locations (C:\Users\ABC123\AppData\Local\Application Data), so no overall loss there.

Still weird that there has been a downgrade in permissions and now requires users to elevate before launch in order to scan some common directories (might need to be included in new documentation if it's not already - it currently isn't as far as I see).

@coldReactive
Copy link

coldReactive commented Jun 9, 2023

I still get this today, even if I elevate it to admin:

Searching for files (this may take a while) ...
System.UnauthorizedAccessException: Access to the path 'C:\Documents and Settings' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.AddSearchableDirsToStack(SearchData localSearchData)
   at System.IO.FileSystemEnumerableIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
   at JarInfectionScanner.Form1.<>c__DisplayClass3_0.<buttonScan_Click>b__0()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at JarInfectionScanner.Form1.<buttonScan_Click>d__3.MoveNext()

For those using curseforge, the folder you should scan is in C:\Users\<username>\curseforge by default and doesn't require anything special.

@SKRecreated
Copy link

The issue is resolved if you make the program's searching directory more specific.
For example instead of C:\Users<your username>\Appdata use C:\Users<your username>\AppData\Roaming and then proceed to try it with local by changing 'Roaming' to local.

@Bluscream
Copy link

Bluscream commented Aug 4, 2023

Please make it possible to scan the entire disk such as C:\ because right now it gets stuck on accessing protected folders, can you just make it skip those folders?

a

This is fixed in my fork aswell, which has a download: #20 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants