+ Reply to Thread
Results 1 to 9 of 9

Thread: SEARCHING: Script to change registry permissions.

  1. #1
    Retired Seal
    SealLion's Avatar
    Join Date
    03.05.08
    Location
    The Arctic--Believe it!!
    Posts
    2,079
    Activity Longevity
    0/20 19/20
    Today Posts
    0/5 sssss2079

    SEARCHING: Script to change registry permissions.

    Hi: I am looking for a script to change / modify permissions on the Win 7 registry with the simple click of the mouse rather than having to go through every time to manually change the permissions of any of the registry files. I've had a look around on the internet and haven't been able to find something that is suitable. The script, or even a simple program (which doesn't seem to exist anywhere on the internet either), should also have some capability like. So I was wondering if any one here has come across such a program, which would probably be very small, or a script listed on, for example a discussion board somewhere. As I say, I personally haven't been able to find such a thing but then again, each one of us uses different search words. I haven't had much luck with mine.
    "God, from the mount Sinai
    whose grey top shall tremble,
    He descending, will Himself,
    in thunder, lightning, and loud trumpet’s sound,
    ordain them laws".


    John Milton (1608-1674) in Paradise Lost


    Ripley's SealLion's Believe it or Not! ~ NASCAR car crashes and Windows have just one thing in common.
    Oh, oh. Better use LINUX.
    Reply With QuoteReply With Quote
    Thanks

  2. #2
    See if the attachment works. It is a batch file composed of one executable: subinacl.exe.
    Open the batch and paste the address of your key.

    I can set it up to use a text file. For instance, place all your keys in a file and open the batch for processing.
    Depends on what works for you.

    I also added a function for restoring the ACL after they are edited (but it is not activated in your batch).
    Attached Files Attached Files
    Last edited by Master Razor; 13.07.12 at 23:04.
    Reply With QuoteReply With Quote
    Thanks

  3. #3
    Retired Seal
    SealLion's Avatar
    Join Date
    03.05.08
    Location
    The Arctic--Believe it!!
    Posts
    2,079
    Activity Longevity
    0/20 19/20
    Today Posts
    0/5 sssss2079
    Thanks but can't seem to get it to work. I started the subinacl.exe then reg_own and I did input the registry key address. As a quick note to clarify correct selection of the files, were the one's I just mentioned run in the correct order?? I take it they were as I initially ran according to your instructions and only came up with a what was a very quick .cmd window disappearing as quick as it came up.

    And just for the sake of discussion the address that I am wanting to change permissions with using such a script is the following: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\U SBSTOR and of course all it's child keys.

    I rebooted expecting to have the changes taken effect; however no effect. The error I get is a common one normally seen when unsuccessful in wanting to change some setting. However, for the sake of discussion the error key is the following:

    Cannot delete Disk&Ven_Verbatim&Prod_STORE_N_GO&Rev_1100.Error while deleting key.

    As you can tell, it's a common error dialogue.

    By the way, Master Razor, I did this more than once. 2x in fact. It was the 2nd time after which I rebooted. No effect there after.

    By the way, just for the sake of clarification it isn't actually the USBSTOR key that I am wanting to delete via any permissions alterations, it is actually the subkeys that I wish to delete. Though I need to change permissions on the parent key, which in this case of course is the SYSTEM\. It isn't the USBSTOR key which I initially thought it would be. It's the 'SYSTEM' key actually. The child keys is what I eventually want to delete (the ones listed under USBSTOR) Basically clearing out my usb cache.

    By the way, what is the '_sheets' folder for?? It doesn't contain anything.
    Last edited by SealLion; 14.07.12 at 00:48.
    "God, from the mount Sinai
    whose grey top shall tremble,
    He descending, will Himself,
    in thunder, lightning, and loud trumpet’s sound,
    ordain them laws".


    John Milton (1608-1674) in Paradise Lost


    Ripley's SealLion's Believe it or Not! ~ NASCAR car crashes and Windows have just one thing in common.
    Oh, oh. Better use LINUX.
    Reply With QuoteReply With Quote
    Thanks

  4. #4
    By the way, what is the '_sheets' folder for?? It doesn't contain anything.
    This is the folder where the restore file is placed. If you want to change permissions of an object and you also want to restore the initial permissions.

    By the way, just for the sake of clarification it isn't actually the USBSTOR key that I am wanting to delete via any permissions alterations, it is actually the subkeys that I wish to delete.
    I assume you already have a program or script for this to delete every sub-key within USBSTOR.

    My mistake was that I tried to change the ACL before taking ownership of the object.
    And, contrary to popular belief, subinacl, just like any other ACL editor, needs to do stuff one thing at a time.
    A line like this this:
    Code:
     subinacl /subkeyreg ... /setowner=%username% /grant=%username%=F
    Will never work.
    Attached Files Attached Files
    Last edited by Master Razor; 14.07.12 at 13:59.
    Reply With QuoteReply With Quote
    Thanks

  5. Who Said Thanks:

    BrianBosworth (14.07.12) , SealLion (14.07.12)

  6. #5
    Retired Seal
    SealLion's Avatar
    Join Date
    03.05.08
    Location
    The Arctic--Believe it!!
    Posts
    2,079
    Activity Longevity
    0/20 19/20
    Today Posts
    0/5 sssss2079
    I don't understand what you mean about a program to delete the keys under the USBSTOR?? Normally, one just right clicks to change permissions and go through the permissions change dialogues and then to proceed to delete subkeys. I think perhaps I may have mis-communicated something.

    Anyways, I tried the new .exe program. A longer dialogue did present itself and initially it presented itself only for a very short time. I did try a 2nd time, this time re-booting but no go there after. I tried it a 3rd and 4th time without rebooting because normally one does not need to reboot and the dialogue presented itself for a longer period of time allowing me to copy/paste said dialogue. At the bottom it stated no failures only modifications.

    The dialogue doesn't really say all that much other than to state that some keys couldn't be enumerated and that the administrator is the new owner. So after the longer dialogue presentation which, as I stated, I had to do about 3 to 4 times, came around full-square. It worked. Henceforth, all I needed to do was to right click on USB reg keys cache and 'hey presto' said reg keys containing USB cache was over and done with.

    Great job!! And thanks a million as this is pretty much what I was looking for. A thousand applauses and rep given too.

    One final thing. I understand that the '_sheets' folder will/can contain the backups of said registry permissions; however, it remains empty even with this new 2nd downloadable .exe. Would there be a way to have this introduce the option to reverse registry permissions when desired??
    Last edited by SealLion; 14.07.12 at 20:48.
    "God, from the mount Sinai
    whose grey top shall tremble,
    He descending, will Himself,
    in thunder, lightning, and loud trumpet’s sound,
    ordain them laws".


    John Milton (1608-1674) in Paradise Lost


    Ripley's SealLion's Believe it or Not! ~ NASCAR car crashes and Windows have just one thing in common.
    Oh, oh. Better use LINUX.
    Reply With QuoteReply With Quote
    Thanks

  7. #6
    don't understand what you mean about a program to delete the keys under the USBSTOR?? Normally, one just right clicks to change permissions and go through the permissions change dialogues and then to proceed to delete subkeys.
    I though you had a custom cleaning scrip or something to automatically remove the entries within USBSTOR.

    Anyways, I tried the new .exe program. A longer dialogue did present itself and initially it presented itself only for a very short time.
    Nothing to be afraid about. It is not a bug; it closes itself when the job is done.

    Would there be a way to have this introduce the option to reverse registry permissions when desired??
    The folder remain empty because the backup script is not used.

    The takeown command consists of 3 parameters: object_type , object_path or object_name , object_backup_file (optional)

    Any name can be given for object_backup_file. It will store a text file in _sheets named as the parameter.

    In order to use it add the following parts in red:

    Line 7: call :takeown subkeyreg %_key% usbstor

    Add the following before the exit command in line 9:
    pause
    call :restoreown usbstor

    The first command will backup the original permissions to a .text file and the restoreown command will restore those permissions from the .txt file
    The pause command is used to give you a break. It gives you full access, the batch pauses for an unlimited time to give you the time needed to remove the contents of USBSTOR. When done you just press any key and the permissions will be restored.
    Say you want to take ownership of multiple keys. For each takeown command a restoreown must be used in order to backup and restore the changes.

    Great job!! And thanks a million as this is pretty much what I was looking for. A thousand applauses and rep given too.
    Thank you for the compliment.
    Last edited by Master Razor; 14.07.12 at 21:07.
    Reply With QuoteReply With Quote
    Thanks

  8. #7
    BrianBosworth's Avatar
    Join Date
    17.04.08
    Location
    Under The Radar
    P2P Client
    Bangladesh Extreme Mod
    Posts
    196
    Activity Longevity
    0/20 19/20
    Today Posts
    0/5 ssssss196
    Sorry I didn't respond to your post in a timely manner. I wasn't quite sure what you were looking for. I was going to suggest using RegOwnit. but Master Razor has already created the perfect solution.
    Reply With QuoteReply With Quote
    Thanks

  9. Who Said Thanks:

    SealLion (15.07.12)

  10. #8
    Retired Seal
    SealLion's Avatar
    Join Date
    03.05.08
    Location
    The Arctic--Believe it!!
    Posts
    2,079
    Activity Longevity
    0/20 19/20
    Today Posts
    0/5 sssss2079
    I take it then that the pause command is not an automatic response from within the batch file as I didn't see it after running the batch file. Silly question I have to ask is that I"m asking because I take it that the pause command is just not written in red even though it is a separate command apart from the other 2 which are followed by the USBSTOR in red. Is that correct??

    @Brian: I didn't come across that one while searching. Like I say above, different search terms, I would imagine.
    Last edited by SealLion; 15.07.12 at 00:44.
    "God, from the mount Sinai
    whose grey top shall tremble,
    He descending, will Himself,
    in thunder, lightning, and loud trumpet’s sound,
    ordain them laws".


    John Milton (1608-1674) in Paradise Lost


    Ripley's SealLion's Believe it or Not! ~ NASCAR car crashes and Windows have just one thing in common.
    Oh, oh. Better use LINUX.
    Reply With QuoteReply With Quote
    Thanks

  11. #9
    Quote Originally Posted by SealLion View Post
    I take it then that the pause command is not an automatic response from within the batch file as I didn't see it after running the batch file. Silly question I have to ask is that I"m asking because I take it that the pause command is just not written in red even though it is a separate command apart from the other 2 which are followed by the USBSTOR in red. Is that correct??

    @Brian: I didn't come across that one while searching. Like I say above, different search terms, I would imagine.
    I forgot to make it read. Sorry.
    It is a separate command that didn't exist before.
    Reply With QuoteReply With Quote
    Thanks

  12. Who Said Thanks:

    SealLion (15.07.12)

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •