|
-
Jan 21st, 2010, 06:32 AM
#1
Thread Starter
Member
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!
-
Jan 21st, 2010, 07:58 AM
#2
Re: UnauthorizedAccessException, need help!
Let me guess, you're probably using Windows Vista ¿
VB.NET MVP 2008 - Present
-
Jan 21st, 2010, 08:43 AM
#3
Thread Starter
Member
Re: UnauthorizedAccessException, need help!
I'm using Windows 7
-
Jan 21st, 2010, 11:36 AM
#4
Re: UnauthorizedAccessException, need help!
Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum
-
Jan 21st, 2010, 12:04 PM
#5
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.
Last edited by weirddemon; Jan 21st, 2010 at 12:24 PM.
Reason: Same as usual: Spelling mistkes ;)
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Jan 21st, 2010, 12:49 PM
#6
Thread Starter
Member
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?
-
Jan 21st, 2010, 02:04 PM
#7
Re: UnauthorizedAccessException, need help!
 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.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Jan 21st, 2010, 02:36 PM
#8
Thread Starter
Member
Re: UnauthorizedAccessException, need help!
I didn't read the post well 
But it doesn't work 
How to elevate permissions?
-
Jan 21st, 2010, 02:39 PM
#9
Re: UnauthorizedAccessException, need help!
 Originally Posted by Prato95
I didn't read the post well 
But it doesn't work 
How to elevate permissions?
1. It worked for me.
2. Google. Do a little leg work
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
-
Jan 21st, 2010, 03:14 PM
#10
Thread Starter
Member
Re: UnauthorizedAccessException, need help!
1. Do not work in Windows 7
2. Googled. Jogging didn't help.
What now?
-
Jan 21st, 2010, 05:11 PM
#11
Re: UnauthorizedAccessException, need help!
 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.
CodeBank contributions: Process Manager, Temp File Cleaner
 Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|