locked
Windows 7 "reg.exe flags" option not working at all? RRS feed

  • Question

  • Is anyone else seeing this? I've spent a day or so trying to QUERY and SET HKLM\Software\Key FLAGS using REG.EXE on Windows7. All it does is endlessly repeat the REG.EXE FLAGS /? help display. The exception is if the parameters are entered incorrectly, it then displays a syntax error.

     

    I'm running as Administrator on an up-to-date brand new Windows 7 installation. I try the same commands on a Vista system and they work just fine. I don't see anyone else having this problem so I suspect there must be something I'm doing wrong.

    I've examined the properties of REG.EXE on both versions:

    The Vista version is: 6.0.6000.16386 1/18/2008 59k

    The Windows7 version is: 6.1.7600.16385 7/13/2009 61k

    I read many articles on UAC and even one on attempting to manipulate FLAGS via API:

    http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx

    http://www.computersplace.com/in-vista-how-does-the-flags-switch-of-regexe-work/virtualization

    On a Vista laptop:

    reg flags hklm\software query

    Worked fine. Then I went ahead and used RegEdit to add a hklm\software\test key, and set its flags with:

    reg flags hklm\software\test set dont_virtualize recurse_flag

    And it worked fine as well.

    Rob

    • Edited by phobosonor Friday, September 3, 2010 1:38 PM
    Friday, September 3, 2010 1:16 AM

Answers

  • Rob,

    I did the test on my windows 7 system and i could perform the command without any problem (i have the same version of your executable). So most likely you have a 3rd party application that messes with reg.exe.

    Try to perform the command with your antivirus disabled.
    Try the command in safemode and if those not work try a clean boot.(http://support.microsoft.com/kb/331796/en-us).

    Kind Regards
    DFT


    IM me - TWiTTer: @DFTER
    • Marked as answer by Arthur Xie Wednesday, September 8, 2010 5:47 AM
    Monday, September 6, 2010 8:45 AM

All replies

  • Rob,

    Try this command in an admin command prompt.
    reg.exe flags HKLM\Software\Key1 QUERY

    does your registery path contains withspaces?

    Kind Regards
    DFT

    IM me - TWiTTer: @DFTER
    Friday, September 3, 2010 11:27 AM
  • Thanks for replying, Daft..

    I apparently left off "query" in my initial post, corrected now.  But no, none of my keys contain any whitespace, so didn't require any quotes. 

    Whether I do QUERY or SET or CLEAR matters not, all show the same help blurb attained with FLAGS /?:

    C:\Users\rbrock>REG FLAGS HKLM\Software\Test QUERY
    
    REG FLAGS KeyName [QUERY |
              SET [DONT_VIRTUALIZE] [DONT_SILENT_FAIL] [RECURSE_FLAG]]
    
     Keyname  "HKLM\Software"[\SubKey] (Restricted to these keys on
        local machine only).
      SubKey  The full name of a registry key under HKLM\Software.
     DONT_VIRTUALIZE DONT_SILENT_FAIL RECURSE_FLAG
      Used with SET; flags specified on the command line will be set,
        while those not specified will be cleared.
    
    Examples:
    
     REG FLAGS HKLM\Software\MyCo\MyApp QUERY
      Displays the current flags of the key MyApp.
    
     REG FLAGS HKLM\Software\MyCo\MyApp SET DONT_VIRTUALIZE /s
      Sets the DONT_VIRTUALIZE flag (and clears DONT_SILENT_FAIL and
      RECURSE_FLAG) on MyApp and all its subkeys
    
    
    C:\Users\rbrock>REG FLAGS HKLM\Software\Test SET DONT_VIRTUALIZE RECURSE_FLAG
    
    REG FLAGS KeyName [QUERY |
              SET [DONT_VIRTUALIZE] [DONT_SILENT_FAIL] [RECURSE_FLAG]]
    
     Keyname  "HKLM\Software"[\SubKey] (Restricted to these keys on
        local machine only).
      SubKey  The full name of a registry key under HKLM\Software.
     DONT_VIRTUALIZE DONT_SILENT_FAIL RECURSE_FLAG
      Used with SET; flags specified on the command line will be set,
        while those not specified will be cleared.
    
    C:\Users\rbrock>
    This is definitely a mystery.  I saw one person's post somewhere in the hours of googling that said it did nothing for him as well, but that post was a few years old. 
    Friday, September 3, 2010 1:48 PM
  • did you run this command in an administrative command promt?
    You the link bellow explains how you need to do this.

    http://www.geekstogo.com/forum/topic/146674-windows-vista-run-command-prompt-as-administrator/

    Kind Regards
    DFT


    IM me - TWiTTer: @DFTER
    Friday, September 3, 2010 2:17 PM
  • Thanks again, Daft, I sure did run as admin.  I wish it would give me access denied, anything but just showing the help text over and over! 

    Regards, Rob

     

    Friday, September 3, 2010 3:12 PM
  • Rob,

    I did the test on my windows 7 system and i could perform the command without any problem (i have the same version of your executable). So most likely you have a 3rd party application that messes with reg.exe.

    Try to perform the command with your antivirus disabled.
    Try the command in safemode and if those not work try a clean boot.(http://support.microsoft.com/kb/331796/en-us).

    Kind Regards
    DFT


    IM me - TWiTTer: @DFTER
    • Marked as answer by Arthur Xie Wednesday, September 8, 2010 5:47 AM
    Monday, September 6, 2010 8:45 AM
  • I think the confusion stems from using an administrator account to execute the reg flags query on the system hklm\software registry - this registry is never virtualized for admin because admin is defacto system and system doesn't virtualize itself ergo you need a non admin account to virtualize to- These flags are stored in the user hklm registry hive where the virtualization takes place. I had same problem trying to query and set flags from admin account on the system local machine registry its not possible ; you just get the help menu repeated again. try a non admin user account and you can set the reg flag and query. because thats where you need the virtualization.


    this articles gives a hint for the explanation: https://technet.microsoft.com/en-us/library/cc138019.aspx
    • Edited by kisshu Sunday, April 23, 2017 1:44 AM
    Sunday, April 23, 2017 1:42 AM