.

1/12/2008

FIX: Requested Registry Access is not allowed (Visual Studio 2008)

Symptom: in Visual Studio 2008, you attempt to add a new WebContentForm and associate it with a MasterPage. You receive an error dialog "Requested Reqistry Access is not allowed".

Don't ask me what caused this; I'm guessing that the registry keys involved had their access denied due to removal of a previous version of Visual Studio, leaving the new guy (Visual Studio 2008) in the lurch.

Here's the fix:

Download "subinacl" here. This is a command-line tool that enables administrators to obtain security information about files, registry keys, and services, and transfer this information from user to user, from local or global group to group, and from domain to domain.

After installing subinacl.exe (it will be in the C:\Program Files\Windows Resource Kits\Tools folder.), drop to a command prompt and run the following batch file, which you have saved in the same folder with the filename "FIX.bat":

subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0 /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0 /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0 /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=system=f

BAM! All fixed! Have fun.

57 Comments:

OpenID yankees26an said...

Works great on Vista!

You did all the hard work :)

3:32 PM  
Anonymous Anonymous said...

Thank you... you saved me

7:02 PM  
Anonymous Anonymous said...

Didn't work for me. I still get the same message when I try to open a new project.

7:31 PM  
Anonymous Anonymous said...

I just posted a few minutes ago that it didn't work for me. However, I found this, and now it works: subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f
subinacl /subdirectories %windir%\*.* /grant=administrators=f /grant=system=f

7:55 PM  
Blogger Tran Dinh said...

thks! great solution :)

5:52 AM  
Blogger dario borsotti said...

thanks, also for my Vista Premium edition the second solution is perfect!

6:47 AM  
Anonymous Anonymous said...

This works. The second FIX worked for me on Vista. Let it run and VS will not have the issues anymore. I can't say how much I am thankful for finding this fix. THANKS!!!

3:57 AM  
Anonymous Anonymous said...

CLOSE ALL COPIES OF VS2008.

Download and Install SubInACL (AS ADMINISTRATOR)

Create bat file, with the lines provided above. Close it. Run bat (as administrator if your not an admin).

Works flawlessly on Vista Ultimate SP1 + VS 2008 Std installed ontop of VB/VWD 2008 Express Remenants.

3:01 AM  
Anonymous danilo said...

I love you man!!!!!!1 You are great!!!!!!!!!!!!!! You save my life with this article!! XD Thank's a lot!!!!

7:34 PM  
Blogger El Tiguere said...

working great for me, thank you very much.

====================
http://tvradionet.com

5:58 PM  
Anonymous Dave said...

The 2nd solution looks like it changes the permissions on everything in the Registry. Is that the case?

I wanted something specific to VCSExpress, so I looked in the Registry for references to it. There were about 20 or so entries all of which said Access Denied when clicked.

However, running a batch file with these statements

subinacl /subkeyreg HKEY_CLASSES_ROOT\VCSExpress.csproj.9.0 /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VCSExpress.csproj.9.0 /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VCSExpress.csproj.9.0 /grant=system=f

gave access to the csproj entry.

Attempting to create a project in VCSEXpress still doesn't work, so I guess I'll have to run the same subinacl command against ALL relevant entries. Can a wildcard be used?

11:56 AM  
Anonymous Anonymous said...

Most Excellent!!!

Thanks a bunch.

11:44 AM  
Blogger Pugnator said...

The solution proposed by Peter didn't run on my computer, but someone from Microsoft helped me.

Look at the 2nd Gilles TOURREAU's answer. You just need to change something in the registery.

Have a look at : http://forums.microsoft.com/MSDN-FR/ShowPost.aspx?PostID=3457523&SiteID=12&mode=1

4:21 AM  
Anonymous Olivier said...

You've saved my life... thanks

3:25 AM  
Anonymous Anonymous said...

Does not work with registries in Windows x64 versions.

12:42 AM  
Anonymous Anonymous said...

I Allowed to Administrator, Users, and System the whole HKEY_CURRENT_USER using the regedit GUI. Now I can view all keys that I can't see before. The problem is that the issue keeps on, when i create a new project, it saind "Requested registry access is not allowed" (Important data: with this modification, the error message appears in English [At the begining, appears in Spanish if you have vista in spanish])
Other ideas???

OS:Vista Busisness
App: Visual Studio 2008
150 more applications installed.
VS2008 worked with the same configuration before format mi PC.

10:32 AM  
Blogger Diego Solorzano said...

thank you, very useful.

3:17 AM  
Anonymous Anonymous said...

Thanks a lot it worked.

5:51 PM  
Anonymous Anonymous said...

very special thanks to you, !!! youknow, I think it is a shame for microsoft because they forgot to test their VS product on Windows Vista !! haha , but thanks any way, it works now !! :D

1:14 PM  
Anonymous Ramazan said...

VERY VERY VERY thanks form ISTANBUL,TURKEY!

this was my big problem. Thanks a lot my firend :D

Çok sevaba girdin adamım ;)

3:45 PM  
Anonymous Anonymous said...

thanks a bunch. the 2nd suggestion worked!!!

3:52 PM  
Anonymous Samson said...

woot!! it works, the only problem is i got more then 200k files in the registry

9:58 PM  
Anonymous Anonymous said...

Doesn't work for me. I don't have a fix.bat file and when I run the program, it flashes into a cmd screen for about half a second then returns. I try running in administrator but it doesn't work. How do I make this work im getting frustrated!!!! :( >-(

7:28 AM  
Blogger Thomas said...

For those who are lost. To create the batch file, open notepad and copy and paste the above lines.

Then save the file as fix.bat in the C:\Program Files\Windows Resource Kits\Tools folder.

When you run subinacl.exe, a dos box will open and then close.

After that, open command prompt (Start, type cmd, right click 'cmd' and run as administrator).
At the command prompt type:
cd C:\program files\windows resource kits\tools (hit 'enter')

fix.bat (hit 'enter')

The program will take a while to run. When it is finished you can run VS 2008.

BTW, the second fix worked for me.
Thx fellers!

12:57 PM  
Anonymous Anonymous said...

neither worked for me. All the registries report that they failed.

am i missing something?

-I installed subinacl
-created "fix.bat" with 2nd solution where subinacl is found.
-ran subinacl (to test)
-ran cmd prompt under Admin and cd'd the folder and loaded the fix.bat file.

-it goes through 300,000+ registries before restarting the whole process over.

32bit vista
compaq presario F700
1.9ghz Athlon 64 X2.

10:40 PM  
Anonymous MiooiM said...

Wow! Thank you very much!!!

2:49 PM  
Anonymous Anonymous said...

you also need to adjust the .sln, .vcs ,.vbz etc entries to get it to work...

9:04 AM  
Blogger Darrell said...

I just used this line to get the VSEXPRESS issue corrected
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f

Darrell

5:25 PM  
Anonymous chin said...

yay it worked!!! =) coool! thanks a lot guys.

10:37 AM  
Anonymous Anonymous said...

There are a lot of posts on this subject with many "broad stroke" fixes, but they all cause trouble because of their scope. I have narrowed it down to two registry keys(after several hours of trial and error). I used Acronis TrueImage Home 11's Try&Decide Feature to quickly un-do changes to my system. I am using Visual C# Express Edition 2008, on Vista Business Edition x64. Full Visual Studio may be different.

Download and install "subinacl" from Microsoft.

Create a batch file with just the two lines below":
(You are granting full permissions to the "administrators", and "system" groups and read-only permissions to the "users" group.)

Save the file as "fix.bat" in the install directory that "subinacl" software was installed in (C:\Program Files (x86)\Windows Resource Kits\Tools)**
**32-bit versions of windows will probably be located at (C:\Program Files\Windows Resource Kits\Tools).
------------------------------------------------------------------------------


subinacl /subkeyreg HKEY_CLASSES_ROOT\.csproj /grant=administrators=f /grant=system=f /grant=users=r
subinacl /subkeyreg HKEY_CLASSES_ROOT\VCSExpress.csproj.9.0 /grant=administrators=f /grant=system=f /grant=users=r


------------------------------------------------------------------------------
Both keys must have permissions set ... not just one.

Open a command prompt (with administrator rights), change the directory(cd) to where you saved the batch file (see above note).
Type in fix.bat
It will finish very quickly.
You should be able to create new VCS programs again.

Israel

********************** Visual C# 2005 Express Edition will probably use different keys ... instead of VCSExpress.csproj.9.0, I think it will be VCSExpress.csproj.8.0 instead. ************************ Browse your registry to check for sure.

1:04 AM  
Anonymous Anonymous said...

hey

didn´t work for me :(
i tried all versions...
...but the weird thing is
i get an error in cmd when i type in -> fix.bat
it writes (in German:HKEY_CLASSES-ROOT:administrator 1337 Die Struktur der Sicherheitserkennung ist unzulässig
programm wird nicht ausgeführt
in english:HKEY_CLASSES-ROOT:administrator 1337 security identification is not valid
program will not be processed)
-> i have the german version :)

i have done all the things
1. run subinacl
2. create fix.bat file
3. open cmd and type in (cd C:\program files\windows resource kits\tools (enter)
fix.bat (enter)

=> error

i hope someone has a good idea for me because i am really frustrated and helpless.
maybe i did something wrong???

PS: vista ultimate

thx tom

3:18 PM  
Anonymous Anonymous said...

In other languages the batch fil has to be modified according to the language.

In German it has to be this way :
ubinacl /subkeyreg HKEY_CLASSES_ROOT\.csproj /grant = Administratoren=F /grant=system=F /grant = Benutzer=R
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=Administratoren=F /grant=system=F /grant=Benutzer=R

Theo

9:30 AM  
Anonymous Anonymous said...

In other languages the batch fil has to be modified according to the language.

In German it has to be this way :
ubinacl /subkeyreg HKEY_CLASSES_ROOT\.csproj /grant = Administratoren=F /grant=system=F /grant = Benutzer=R
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=Administratoren=F /grant=system=F /grant=Benutzer=R

Theo

9:32 AM  
Anonymous Anonymous said...

Thanks baby, you are the best, very helpful!

8:18 PM  
Anonymous Anonymous said...

respect rasta! worked perfectly!

9:41 AM  
Blogger ira said...

i friggin' love you man! the 2nd vista fix worked.

5:52 PM  
Anonymous Alex said...

Thnx to Peter for the solution and thnx to our anonymous friend from Germany for the hint: I spent some 20 minutes trying to find out where I was wrong, and it was my Russian Vista which uses Russian words for "administrators" and "users"))) I would never believe Windows does it!!! I was sure these Russian substitutes are only aliases, and the true names should be exactly "administrators" and "users". Seems quite logical as my localized copy uses "system" in its original English spelling.

1:31 PM  
Anonymous Anonymous said...

Thank you :) it worked for me on Vista Business x64

2:29 PM  
Anonymous Anonymous said...

Very useful. Thanks a lot.

4:20 AM  
Anonymous Anonymous said...

None of these worked. Didn't try the broad spectrum, cause I don't wanna ruin the rest of my comp. Vista Home Premium, VS2008 Pro, registered, etc. used all the bat files located here, tried everything, fresh install, everything...I'll post a vid on youtube if wanted

help is appreciated, cause Microsoft is useless

12:13 AM  
Blogger afsal said...

Hi ,thanks,if you add more then you can also solve silver light issues like below..........


subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0 /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0 /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0 /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=system=f

subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.Solution.9.0 /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.Solution.9.0 /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.Solution.9.0 /grant=system=f

subinacl /subkeyreg HKEY_CLASSES_ROOT\._sln /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\._sln /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\._sln /grant=system=f

subinacl /subkeyreg HKEY_CLASSES_ROOT\._sln90 /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\._sln90 /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\._sln90 /grant=system=f

subinacl /subkeyreg HKEY_CLASSES_ROOT\AgControl.AgControl /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\AgControl.AgControl /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\AgControl.AgControl /grant=system=f

3:59 AM  
Anonymous Anonymous said...

Didn't work...any other way?

4:50 AM  
Blogger Visual Basic 2005 Express Codes said...

Hey thanks...worked just fine on VB 2008 Studio Pro on Vista SP2 Beta

4:22 PM  
Blogger RO said...

i love you man.good job. and thomas explain very clear. u saved me.thanks

4:27 AM  
Anonymous Anonymous said...

the second code worked for me but when i restarted my comp the sound wouldn't work, internet was disconnected, system restore failed and other system tools failed... nothing would open apart from internet (even though it said it was disconnected). so i restarted, pressed f11 and did system restore from there. so its back to normal now. but i tried the steps again and got VB working again with the second code, but when i restarted again it was the same as before. so i just did the system restore and gave up on VB. (running vista basic btw.)

7:43 PM  
Anonymous Anonymous said...

Thank you great work

5:20 PM  
Blogger rogue said...

You saved loads of my effort. Thanks a ton.

4:49 PM  
Anonymous Anonymous said...

Thanks SO SO SO MUCH. Im an developer and could not get it to work. boy im studpid.

11:06 PM  
Blogger Roland Beenhakker said...

Thanks you saved my day!

3:38 PM  
Anonymous Anonymous said...

the codes really messed up my computer so i stopped using them, they messed up all the drives and had to system restore. But i downloaded visual basic 6.0 which worked, then i tried 2008 again and it worked? strange. after using vb6.0... 2008 suddenly started working o.O

2:14 PM  
Blogger Mo said...

I have been trying every solution available on the internet (almost). Just before I decided to give up I found out what I did wrong.
Have a look at one of the command lines...

****
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
****

I was looking at the line for a few minutes then I realized that my pc´s administrator account IS NOT CALLED "administrators" but instead its "administratorer" (danish).

So I changed from
****
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
****

to

****
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administratorer=f
****

Thats it...everything works now. I just like to remind you that the administrators/users/guests/systemsmay not be called the same from country to country/continent to continent.

Hope this helps out a few.

12:14 PM  
Anonymous yasinator said...

2 questions...
do i paste all the lines or 1 line?
do i have to restart my pc?

5:45 PM  
Anonymous Anonymous said...

2 questions...
do i paste all the lines or 1 line?
do i have to restart my pc?

5:45 PM  
Anonymous Anonymous said...

aahhh I love you guys.. this saved my life!

1:52 AM  
Blogger Chris Emerson said...

Thanks for posting this. I used the initial post and the 3rd comment and my issue seems to be gone now (*.bat took around 20 minutes to run!). FWIW I believe I got the problem from installing SP1 for VS.NET 2008 on Vista... thanks a ton Microsoft.

7:16 AM  
Anonymous Anonymous said...

After lots of trying, "VCSExpress.csproj.9.0" is the key for me. In Registry Editor, I could not even open the key before running the subinacl batch file.

12:22 AM  
Blogger chrisw said...

once i ran it through the command prompt, it worked like a dream, cheers!!!

9:16 AM  

Post a Comment

Links to this post:

Create a Link

<< Home