中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-07 19:54
48,041 topics / 350,128 posts / today 3 new / 48,252 members
DOS批处理 & 脚本技术(批处理室) » How do I change the permissions of the default value?
Printable Version  1,184 / 5
Floor1 5872169 Posted 2008-03-11 10:56
高级用户 Posts 474 Credits 959
How do I change the permissions of the default value? Is there a command that can directly change the permissions of the default value? I want to delete the default value, but it has permissions set, and I don't know how to change them!
Floor2 HAT Posted 2008-03-11 14:20
版主 Posts 5,017 Credits 9,023
Floor3 5872169 Posted 2008-03-11 14:23
高级用户 Posts 474 Credits 959
I want to delete the default value under HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{1171A62F-05D2-11D1-83FC-00A0C9089C5A}\InprocServer32, but when I try to delete it, it says it cannot delete all the specified values! It seems to be a permission issue. I want to change the permissions and delete it, but I don't know how to do that!
Floor4 abcd Posted 2008-03-11 15:07
银牌会员 Posts 739 Credits 1,436
Floor5 5872169 Posted 2008-03-11 15:22
高级用户 Posts 474 Credits 959
Can post #4 explain what your code means?
Floor6 HAT Posted 2008-03-11 20:44
版主 Posts 5,017 Credits 9,023
Originally posted by 5872169 at 2008-3-11 03:22 PM:
Can post #4 explain what your code means?

Let me explain the “code” in post #4 instead :)
Usage:
regini regset.ini

Contents of regset.ini
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Set the Run item so that only system is allowed to control it; other users cannot control it. is the control parameter. See the help below for other parameters.

usage: REGINI

textFiles...

where: -m specifies a remote windows NT machine whose registry is to be manipula
ted.
-h specifies a specify local hive to manipulate.
-w specifies the paths to a windows 95 system.dat and user.dat files
-i n specifies the display indentation multiple. Default is 4
-o outputWidth specifies how wide the output is to be. By default the
outputWidth is set to the width of the console window if standard
output has not been redirected to a file. In the latter case, an
outputWidth of 240 is used.

-b specifies that REGINI should be backward compatible with older
versions of REGINI that did not strictly enforce line continuations
and quoted strings Specifically, REG_BINARY, REG_RESOURCE_LIST and
REG_RESOURCE_REQUIREMENTS_LIST data types did not need line
continuations after the first number that gave the size of the data.
It just kept looking on following lines until it found enough data
values to equal the data length or hit invalid input. Quoted
strings were only allowed in REG_MULTI_SZ. They could not be
specified around key or value names, or around values for REG_SZ or
REG_EXPAND_SZ Finally, the old REGINI did not support the semicolon
as an end of line comment character.

textFiles is one or more ANSI or Unicode text files with registry data.

The easiest way to understand the format of the input textFile is to use
the REGDMP command with no arguments to dump the current contents of
your NT Registry to standard out. Redirect standard out to a file and
this file is acceptable as input to REGINI

Some general rules are:
Semicolon character is an end-of-line comment character, provided it
is the first non-blank character on a line

Backslash character is a line continuation character. All
characters from the backslash up to but not including the first
non-blank character of the next line are ignored. If there is more
than one space before the line continuation character, it is
replaced by a single space.

Indentation is used to indicate the tree structure of registry keys
The REGDMP program uses indentation in multiples of 4. You may use
hard tab characters for indentation, but embedded hard tab
characters are converted to a single space regardless of their
position

Values should come before child keys, as they are associated with
the previous key at or above the value's indentation level.

For key names, leading and trailing space characters are ignored and
not included in the key name, unless the key name is surrounded by
quotes. Imbedded spaces are part of a key name.

Key names can be followed by an Access Control List (ACL) which is a
series of decimal numbers, separated by spaces, bracketed by a
square brackets (e.g. ). The valid numbers and their
meanings are:

1 - Administrators Full Access
2 - Administrators Read Access
3 - Administrators Read and Write Access
4 - Administrators Read, Write and Delete Access
5 - Creator Full Access
6 - Creator Read and Write Access
7 - World Full Access
8 - World Read Access
9 - World Read and Write Access
10 - World Read, Write and Delete Access
11 - Power Users Full Access
12 - Power Users Read and Write Access
13 - Power Users Read, Write and Delete Access
14 - System Operators Full Access
15 - System Operators Read and Write Access
16 - System Operators Read, Write and Delete Access
17 - System Full Access
18 - System Read and Write Access
19 - System Read Access
20 - Administrators Read, Write and Execute Access
21 - Interactive User Full Access
22 - Interactive User Read and Write Access
23 - Interactive User Read, Write and Delete Access

setacl CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /registry /deny administrator /full
rem Explanation:
rem setacl: set -----------------------------
rem CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run: current user's registry branch startup RUN value
rem registry: the type is registry
rem deny: the item is deny access
rem administrator: the access target is administrator
rem full: the permission is full access
rem Simply put, this line means:
rem Set the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run registry value so that the administrator user cannot access it
rem There are four item types: deny (deny) grant (allow) set (set) revoke (revoke)
rem There are two permission types: FULL full access READ read-only access
rem So if we want to restore the item denied above, we only need to use the following command:
rem setacl CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /registry /grant administrator /full
rem Below is a comparison of the beginning parts of each main branch:
rem setacl machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /registry /deny administrator /full
rem setacl USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
rem setacl MACHINE\SYSTEM\CurrentControlSet\Services /registry
rem setacl CLASSES_ROOT\exefile\shell\open\command
rem setacl CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2 /registry /deny everyone /full
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023