2

I'm preparing a batch script that should help me to remove 3 keys from the registry. Unfortunately nobody has permission to edit the keys, except for TrustedInstaller.

To execute my reg file that removes the 3 keys successfully my batch script will call REGINI and try to set the permission to 'full access to everyone'. However, running my script as admin will not being any success.

Here are the contents of my files:

script.bat

@SETLOCAL ENABLEDELAYEDEXPANSION && @SETLOCAL ENABLEEXTENSIONS && @CD /D %~dp0 && TITLE %~f0
REGINI _dlmw.rpf
_dlmw.reg

_dlmw.rpf

\Registry\Machine\SYSTEM\CurrentControlSet\Control\WDI\DiagnosticModules\{45DE1EA9-10BC-4f96-9B21-4B6B83DBF476} [7]
\Registry\Machine\SYSTEM\CurrentControlSet\Control\WDI\DiagnosticModules\{5EE64AFB-398D-4edb-AF71-3B830219ABF7} [7]
\Registry\Machine\SYSTEM\CurrentControlSet\Control\WDI\DiagnosticModules\{C0F51D84-11B9-4e74-B083-99F11BA2DB0A} [7]

_dlmw.reg

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WDI\DiagnosticModules\{45DE1EA9-10BC-4f96-9B21-4B6B83DBF476}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WDI\DiagnosticModules\{5EE64AFB-398D-4edb-AF71-3B830219ABF7}]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WDI\DiagnosticModules\{C0F51D84-11B9-4e74-B083-99F11BA2DB0A}]

Actually, when running the reg file, there are no permissions set for everybody. Accoding to http://support.microsoft.com/kb/245031 this should actually work.

All files are in the same directory, REGINI command does not return any messages.

What do I do wrong?

EDIT

Now I understood I cannot change the permissions, because I'm not the owner of the keys. Without installing something extra would suit my situation better IMHO.

2
  • 2
    The regini tool can't change the registry key owner; you should be using subinacl. Anyway, what's the reason you're trying to suppress the "low on memory" warnings?
    – and31415
    Commented May 13, 2014 at 15:49
  • I got 16GB, and Windows cries on 8GB full RAM already and closes other applications. I like to build scripts for reuse when I re install my windows, such as my disable superfetch/prefetch reg files. Commented May 13, 2014 at 15:53

1 Answer 1

-2

Consider downloading and using subinacl instead.

4
  • Useful exe, works, even when I dislike to use extern programs. Thanks a lot. Commented May 13, 2014 at 16:12
  • 2
    Like-only answers are a no-no. Please include pertinent information directly in your answers, and expand them to be more useful (ie: explain WHY the user would want to do this, and give some idea on how they should use it to accomplish what they're asking). Perhaps peruse superuser.com/help/how-to-answer. Commented May 13, 2014 at 18:27
  • 2
    For my purpose, the answer is complete. however I have to agree with techie007. A bit more side information would be helpful. Specially for others. Even the comment of and31415 in my question clarifies more. You should clearly have told me that I have to change the ownership. Example: SUBINACL /keyreg HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WDI\DiagnosticModules\{45DE1EA9-10BC-4f96-9B21-4B6B83DBF476} /setowner=%USERNAME%>NUL && SUBINACL /keyreg HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WDI\DiagnosticModules\{45DE1EA9-10BC-4f96-9B21-4B6B83DBF476} /grant=%USERNAME%=F>NUL Commented May 14, 2014 at 6:42
  • @tech007 What does "like-only" mean? Only like what? The term "like-only" does not exist on the page you linked.
    – Jason
    Commented May 14, 2014 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .