UnauthorizedAccessException, need help!
Hello, Is there any way to avoid UnauthorizedAccessException, i get it every time when I try to do this:
Code:
My.Computer.Registry.ClassesRoot.OpenSubKey("Applications").CreateSubKey("Explorer.exe")
Is there any way to make that script read-write?
Thanks!
Re: UnauthorizedAccessException, need help!
Let me guess, you're probably using Windows Vista ¿
Re: UnauthorizedAccessException, need help!
Re: UnauthorizedAccessException, need help!
Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum
Re: UnauthorizedAccessException, need help!
Add True as an argument when opening the key. Otherwise, the default is False which is ReadOnly. If that doesn't work, you'll need to elevate permissions.
Re: UnauthorizedAccessException, need help!
If you mean like this:
vb Code:
My.Computer.Registry.ClassesRoot.OpenSubKey("Applications").OpenSubKey("Explorer.exe").CreateSubKey("Drives", True)
It doesn't work, but how do I elevate permissions?
Re: UnauthorizedAccessException, need help!
Quote:
Originally Posted by
Prato95
If you mean like this:
vb Code:
My.Computer.Registry.ClassesRoot.OpenSubKey("Applications").OpenSubKey("Explorer.exe").CreateSubKey("Drives", True)
It doesn't work, but how do I elevate permissions?
No. I said add it to the Opening Key part, not when creating the key -_-
VB.NET Code:
My.Computer.Registry.ClassesRoot.OpenSubKey("Applications").OpenSubKey("Explorer.exe", True ).CreateSubKey("Drives")
Even if you elevate permissions, you'll need to change the write permissions like I said.
Re: UnauthorizedAccessException, need help!
I didn't read the post well :D
But it doesn't work :(
How to elevate permissions?
Re: UnauthorizedAccessException, need help!
Quote:
Originally Posted by
Prato95
I didn't read the post well :D
But it doesn't work :(
How to elevate permissions?
1. It worked for me.
2. Google. Do a little leg work
Re: UnauthorizedAccessException, need help!
1. Do not work in Windows 7
2. Googled. Jogging didn't help.
What now?
Re: UnauthorizedAccessException, need help!
Quote:
Originally Posted by
Prato95
1. Do not work in Windows 7
2. Googled. Jogging didn't help.
What now?
You figure out on our own now. I was trying to help you help yourself, but you decided to be a jerk.