MSDN > 論壇首頁 > Visual Basic IDE > Requested Registry Access is not allowed Error
發問發問
 

已答覆Requested Registry Access is not allowed Error

  • Wednesday, 3 October, 2007 21:36blund69 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

     

    When ever I try to create a new project, any project using VS2008 B2 running on Vista I get this error. "Requested Registry Access is not allowed." Obvious registry thing bu t would rather not get into and mess with any hives - any suggestions would be great.

     
    Steps to Reproduce
    Click File > New Project then select any project type i.e. windows > vb > Windows Form Application
    Choose any language or project type
     
    Actual Results
    Get this error "Requested Registry Access is not allowed"
     
    Expected Results
    I would expect VS2008 to create requested project type and let me start coding.

     

解答

  • Sunday, 7 October, 2007 1:58NGPixel 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    Had the same problem, it's a problem with the permissions in the registry. Basically, Administrator doesn't have access to the key required by VS. Solution:

    !! CLOSE VISUAL STUDIO FIRST !!

    Step 1: Download subinacl.msi from the link
    http://go.microsoft.com/fwlink/?LinkId=23418 and install it.

    Step 2: Browse to C:/Program Files/Windows Resource Kits/Tools/ and create a file called vs2008fix.txt

    Step 3: Open the file you created, and inside copy-paste:

    Code Block

    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


    Step 4: Save the file and change the file extension to ".cmd". Then Start > Run. Type "cmd" (without the quotes) and type:

    cd C:/Program Files/Windows Resource Kits/Tools

    Step 5: Press Enter. Then type:

    vs2008fix.cmd

    Step 6: Wait until it completes, then start Visual Studio again. You should be able to create project/files of any type.

    Enjoy

所有回覆

  • Sunday, 7 October, 2007 1:58NGPixel 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    Had the same problem, it's a problem with the permissions in the registry. Basically, Administrator doesn't have access to the key required by VS. Solution:

    !! CLOSE VISUAL STUDIO FIRST !!

    Step 1: Download subinacl.msi from the link
    http://go.microsoft.com/fwlink/?LinkId=23418 and install it.

    Step 2: Browse to C:/Program Files/Windows Resource Kits/Tools/ and create a file called vs2008fix.txt

    Step 3: Open the file you created, and inside copy-paste:

    Code Block

    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


    Step 4: Save the file and change the file extension to ".cmd". Then Start > Run. Type "cmd" (without the quotes) and type:

    cd C:/Program Files/Windows Resource Kits/Tools

    Step 5: Press Enter. Then type:

    vs2008fix.cmd

    Step 6: Wait until it completes, then start Visual Studio again. You should be able to create project/files of any type.

    Enjoy
  • Wednesday, 21 November, 2007 9:38vince2007 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    when i got to do this CMD returns that

    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

    none of these exist...   what do i do now?
  • Wednesday, 21 November, 2007 9:39vince2007 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    when i got to do this CMD returns that

    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

    none of these exist...   what do i do now?
  • Saturday, 24 November, 2007 12:53Anonymous11338 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    same issue for me of the files not existing.....

     

  • Saturday, 24 November, 2007 18:00NGPixel 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    This code is for the BETA 2 ONLY and team/professional versions should work as well, it will not fix anything on Express editions.

    Simply look in the HKEY_CLASSES_ROOT (in your registry) for a similar key depending on which program you are using. For example, Visual Basic Express 2008 would be:

    HKEY_CLASSES_ROOT\VBExpress.vbproj.9.0

    The issue is always on (SOFTWARE).vbproj.9.0 whatever the software is, so simply look for that key in your registry and replace in the code.
  • Sunday, 25 November, 2007 10:17nntv 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Thanks NGPixel for giving me the idea.THis code will probably solve all (or at least almost) the problems of windows (especially windows Vista) that relate to security issues.


    Code Block


    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f

    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f




    Create a text file in folder "C:\Program Files\Windows Resource Kits\Tools" and save as *.cmd extention (eg 'fixsecurity.cmd') and double click on the file to run.

    Note: Make sure to close all the running program to ensure the result. It will take alot of time to finish runing the codes (about 2 hours or more) so take a nap while it runs.
  • Sunday, 25 November, 2007 16:06NGPixel 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    I doubt this will fix any problem, it will create even more so USE WITH CAUTION. I've already seen this solution on another website and the 10 next replies was that their Vista was completely messed up, from drivers not working anymore, programs crashing, many errors on startup, etc. Many of them had to reinstall Vista or restore a registry backup.

    I suggest not using this code, even if that looks totally logical, its most likely to lead to many problems.
  • Thursday, 7 February, 2008 9:10megatron666 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    I have the same problems as all above with the Visual Basic Express 2008. I used SpyMe Tools (http://www.lcibrossolutions.com/spymetools) to monitor the registry. I truncated the list to a particular section when the "Registry Error" appears:

     


    1:03:35 AM vbexpress.exe: 1188 OpenKey HKCR\CLSID\{C964830F-91A0-11D0-B14C-0000F8041356}\InprocServer32 FAILED (2)
    1:03:35 AM vbexpress.exe: 1188 OpenKey HKLM\Software\Microsoft\VBExpress\9.0\CLSID\{C964830F-91A0-11D0-B14C-0000F8041356} SUCCESS
    1:03:35 AM vbexpress.exe: 1188 QueryValue HKLM\Software\Microsoft\VBExpress\9.0\CLSID\{C964830F-91A0-11D0-B14C-0000F8041356}\InprocServer32 SUCCESS
    1:03:35 AM vbexpress.exe: 1188 CloseKey HKLM\Software\Microsoft\VBExpress\9.0\CLSID\{C964830F-91A0-11D0-B14C-0000F8041356}\ SUCCESS
    1:03:35 AM vbexpress.exe: 1188 OpenKey HKCR\.vbproj FAILED (5)
    1:03:35 AM vbexpress.exe: 1188 OpenKey HKLM\Software\Microsoft\VBExpress\9.0 SUCCESS
    1:03:35 AM vbexpress.exe: 1188 OpenKey HKLM\Software\Microsoft\VBExpress\9.0\VsTemplate\Project SUCCESS
    1:03:35 AM vbexpress.exe: 1188 QueryValue HKLM\Software\Microsoft\VBExpress\9.0\VsTemplate\Project\CacheFolder SUCCESS
    1:03:35 AM vbexpress.exe: 1188 CloseKey HKLM\Software\Microsoft\VBExpress\9.0\VsTemplate\Project\ SUCCESS

    I highlighted in bold a open key querry that failed 5 times. This happens every time I try to open a new project. Two observations:

     

    1) Interesting enough, when I look for that entry in regedit, it does not exist.

    2) When I proble within the registry near the values "HKLM\Software\Microsoft\VBExpress" I, as an administrator, do not have any access to view or modify the permissions

  • Wednesday, 13 February, 2008 2:44biggestsonicfan 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    I've been having such major problems with trying to get VS 2005 working on vista, and I've used subinacl on all HKEY_CLASSES_ROOT\VisualStudio.* (where * is valid VisualStudio keys, as subinacl doesn't seem to work well with wildcards), but then I finally used subacl on all file extensions used by VisualStudio, including HKCR\.vbproj, and bravo! I now have a fully working Visual Studio! Thank you very much Megatron666!
    I've been having such major problems with trying to get VS 2005 working on vista, and I've used subinacl on all HKEY_CLASSES_ROOT\VisualStudio.* (where * is valid VisualStudio keys, as subinacl doesn't seem to work well with wildcards), but then I finally used subacl on all file extensions used by VisualStudio, including HKCR\.vbproj, and bravo! I now have a fully working Visual Studio! Thank you very much Megatron666!

    EDIT on 03/05/08: Well, I installed the C++ component to Visual Studio 2005, and all project creations fail. There is no "Requested Registry Acess" error. I kept fishing through the registry to find anything linked to VS2005, and I had no luck. I tried using SpyMe Tools, but Vista seems to crash hard when a program attempts to hook to specific parts of the system that are constantly reading and writing to the registry. Anyway, I decided to take my chances with the "USE AT OWN RISK" solution. I was shocked to my foundation when it worked! UNTIL I HAD TO REBOOT! Sound was gone, network functions pretty much shot, Vista Sidebar Gadgets going haywire, services not having enough "disk space" on my 10+ gigs free hard drive, unable to run system restore, yadda yadda yadda.... Well, I did indeed figure that something drastic like this would happen, and it was a test only. Fortuinately, I used Resplendant Registrar to backup my entire registry, and restored the backup. Once I rebooted, everything was almost back to normal. I then used the system restore point I made just after creating the registry backup, and right before I did the insane registry permission changes. Everything seems to be 100% now. I still cannot use C++ now, but I will keep looking for a solution.

    Visual Studio 2008 is not a solution, by the way. I recieved the "Requested Registry Access is not allowed" error along with project creation failed for Visual Basic projects, and just project creation failures with C++ projects. I just really don't want to use Borland's C++ compiler, because I was so used to the VS interface. Oh well. I'm sure I'll find some other nice IDE.

    EDIT on 03/19/08: I found the culprit:

    Code Snippet

    subinacl /subkeyreg HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VsWizard.VsWizardEngine.8.0 /grant=administrators=f /grant=users=f /grant=system=f


    Doing that once fixed my C++ problem. Hope it helps other people out there!
  • Thursday, 20 March, 2008 21:44alsaidis 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    Hello all. Itried the same approach biggestsonicfan did but it didn´t solve the problem. So I used "Process Monitor" to monitor registry access at the moment I got the error and the "problem" key was HKCR\VBExpress.vbproj.9.0

     

    Using this script solved my problem (after using it for all HKEY_CLASSES_ROOT\VisualStudio.* keys too, so it might be a combination of both)

     

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

     

    Hope it helps. If it doesn't, you can use Process Monitor and look for "ACCESS DENIED" events from process "vbexpress.exe"

  • Tuesday, 22 April, 2008 14:27Sh4d 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Thank you so much. That worked for me.

    This probably works for visual studio:

    ubinacl /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
  • Saturday, 24 May, 2008 13:15Calvin Tavarez 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Help! I use this code:
    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f

    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f
    And my system is all messed up. I can't do a system recovery because I have many files that I need.

    IS THERE ANY WAY TO RESTORE MY COMPUTER? I NEED HELP FAST AND QUICK. THAT CODE MESSED EVERYTHING UP >Sad
  • Saturday, 24 May, 2008 13:17Calvin T_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Help! I use this code:
    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f

    subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f
    subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f
    subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f
    And my system is all messed up. I can't do a system recovery because I have many files that I need.

    IS THERE ANY WAY TO RESTORE MY COMPUTER? I NEED HELP FAST AND QUICK. THAT CODE MESSED EVERYTHING UP >Sad

    PLEASE CONTACT ME AT MEMOTTOLIVE@HOTMAIL.COM IF YOU CAN HELP FIX THIS WITHOUT DOING A SYSTEM RECOVERY!
  • Wednesday, 8 October, 2008 6:12IsraelP 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     提議的解答
    There are alot 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.
    I hope it helps you. I had been pulling my hair out with this one.

    Israel
    • 已提議為解答J°3 Friday, 31 October, 2008 15:51
    •  
  • Tuesday, 2 December, 2008 16:55Random Weirdo 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    YOU DO NOT HAVE TO DOWNLOAD ANYTHING
    I used regedit to and edited the owner and permissions on the reg key
    It's probably something like:
    HKEY_CLASSES_ROOT\VBExpress.vbproj.9.0    or
    HKEY_CLASSES_ROOT\VCSExpress.csproj.9.0  or
    HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0
    or something similar depending on what program you've got.
    Right click it and go to permissions. Go onto the security tab. Choose advanced and then go to the owner tab. Click edit then change the owner to yourself. Close the persmissions the reopen it. In the advanced dialog click edit then create full control permissions for system and the administrator as well as permissions for you as a user (read only or full it doesn't matter).
    And that's it. It sorted the problem out for me and I've restarted my computer and everythings fine.
    Hope it works for you.
    This could vary with different operating systems (mine's vista home premium) and Reg editors