how to change a key's permissions with a script?

  • Thread starter Thread starter ToddAndMargo
  • Start date Start date
T

ToddAndMargo

Hi All,

I can not get the following *.reg file to work because of a
permission setting on the key (I can manually alter
the key's and sub key's permissions to "everyone",
then this will work.)

REGEDIT4
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Enum\Root\LEGACY_PAVAGENTE]

What a pain.

How do I change this key's and sub key's permissions
with/from a script (batch file)? Is there a why to tell the *.reg
file to do it?

Many thanks,
-T
 
I can not get the following *.reg file to work because of a
permission setting on the key (I can manually alter
the key's and sub key's permissions to "everyone",
then this will work.)
REGEDIT4
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Enum\Root\LEGACY_PAVAGENTE]

What a pain.
How do I change this key's and sub key's permissions
with/from a script (batch file)? Is there a why to tell the *.reg
file to do it?
Many thanks,
-T

The .reg file can't change permissions. Subinacl can do that:http://www.microsoft.com/downloads/...d8f...http://www.analogduck.com/main/subinacl

or you can try the tool that Mark V suggested yesterday:http://sourceforge.net/projects/setacl/

John

Hi John,

It looks like the SetACL's will do the trick. Thank you!

-T
 
Hi All,

I can not get the following *.reg file to work because of a
permission setting on the key (I can manually alter
the key's and sub key's permissions to "everyone",
then this will work.)

Generally avoid the EVERYONE group. said:
REGEDIT4
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Enum\Root\LEGACY_PAVAGENTE]

What a pain.

Designed that way... :-\
How do I change this key's and sub key's permissions
with/from a script (batch file)? Is there a why to tell the *.reg
file to do it?

There is another approach and solution for this location, namely
DEVCON.EXE.
Running DEVCON requires Administrators authority but can bypass the
default permissions which restrict admins in this registry branch.
It acts as SYSTEM in this scenario.

I actually wrote a REXX script that accepts the "name"
("PAVAGENTE" in your example) and removes the key (under \root\ )
Here are your clues:

devcon findall =LegacyDriver
devcon find @ROOT\LEGACY_XWVO\0000
devcon remove @ROOT\LEGACY_XWVO\0000

NOTE that devcon does not set an errorlevel as expected, so one may
need to capture/test STDOUT for errors or success.

Needless to say, this should be used only for non-active (Stopped,
or uninstalled) items. Full Registry Backup required before you
start playing of course.

DEVCON:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272
 
I can not get the following *.reg file to work because of a
permission setting on the key (I can manually alter
the key's and sub key's permissions to "everyone",
then this will work.)

Generally avoid the EVERYONE group. said:
REGEDIT4
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Enum\Root\LEGACY_PAVAGENTE]
What a pain.

Designed that way... :-\


How do I change this key's and sub key's permissions
with/from a script (batch file)? Is there a why to tell the *.reg
file to do it?

There is another approach and solution for this location, namely
DEVCON.EXE.
Running DEVCON requires Administrators authority but can bypass the
default permissions which restrict admins in this registry branch.
It acts as SYSTEM in this scenario.

I actually wrote a REXX script that accepts the "name"
("PAVAGENTE" in your example) and removes the key (under \root\ )
Here are your clues:

devcon findall =LegacyDriver
devcon find @ROOT\LEGACY_XWVO\0000
devcon remove @ROOT\LEGACY_XWVO\0000

NOTE that devcon does not set an errorlevel as expected, so one may
need to capture/test STDOUT for errors or success.

Needless to say, this should be used only for non-active (Stopped,
or uninstalled) items. Full Registry Backup required before you
start playing of course.

DEVCON:http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272

Thank you! Thank you for the examples too. Sometimes that is the
only
way I learn (including this time).

-T
 
Generally avoid the EVERYONE group. <G>
REGEDIT4
[-HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\
Enum\Root\LEGACY_PAVAGENTE]
What a pain.
Designed that way... :-\
There is another approach and solution for this location, namely
DEVCON.EXE.
Running DEVCON requires Administrators authority but can bypass the
default permissions which restrict admins in this registry branch.
It acts as SYSTEM in this scenario.
I actually wrote a REXX script that accepts the "name"
("PAVAGENTE" in your example) and removes the key (under \root\ )
Here are your clues:
devcon findall =LegacyDriver
devcon find @ROOT\LEGACY_XWVO\0000
devcon remove @ROOT\LEGACY_XWVO\0000
NOTE that devcon does not set an errorlevel as expected, so one may
need to capture/test STDOUT for errors or success.
Needless to say, this should be used only for non-active (Stopped,
or uninstalled) items. Full Registry Backup required before you
start playing of course.

Thank you! Thank you for the examples too. Sometimes that is the
only
way I learn (including this time).

-T

Got out to the site. This did the trick (got everything
but ControlSet002's entries, which works for me!):

devcon remove @ROOT\LEGACY_PAVAGENTE\0000
devcon remove @ROOT\LEGACY_PAVATSCHEDULER\0000
devcon remove @ROOT\LEGACY_PAVDRV\0000
devcon remove @ROOT\LEGACY_PAVREPORT\0000
devcon remove @ROOT\LEGACY_PAVSRV\0000

Thank you!
 
[ ]
[ ]
Got out to the site. This did the trick (got everything
but ControlSet002's entries, which works for me!):

devcon remove @ROOT\LEGACY_PAVAGENTE\0000
devcon remove @ROOT\LEGACY_PAVATSCHEDULER\0000
devcon remove @ROOT\LEGACY_PAVDRV\0000
devcon remove @ROOT\LEGACY_PAVREPORT\0000
devcon remove @ROOT\LEGACY_PAVSRV\0000

Thank you!

You are very welcome. Share it someday with another.
 
Back
Top