中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
作者:
标题: 怎么修改默认键值的权限? 上一主题 | 下一主题
5872169
高级用户





积分 959
发帖 474
注册 2007-10-25
状态 离线
『楼 主』:  怎么修改默认键值的权限?

怎么修改默认键值的权限?有没有命令直接修改默认键值权限,我想删除默认键值,但是有权限,不知道怎么修改!

2008-3-11 10:56
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 2 楼』:  

C:\>reg delete /?

Console Registry Tool for Windows - version 3.0
Copyright (C) Microsoft Corp. 1981-2001.  All rights reserved


REG DELETE KeyName [/v ValueName | /ve | /va] [/f]

  KeyName    [\\Machine\]FullKey
    Machine  Name of remote machine - omitting defaults to the current machine
             Only HKLM and HKU are available on remote machines
    FullKey  ROOTKEY\SubKey
    ROOTKEY  [ HKLM | HKCU | HKCR | HKU | HKCC ]
    SubKey   The full name of a registry key under the selected ROOTKEY
  ValueName  The value name, under the selected Key, to delete
             When omitted, all subkeys and values under the Key are deleted
  /ve        delete the value of empty value name <no name>
  /va        delete all values under this key
  /f         Forces the deletion without propmt

Examples:

  REG DELETE HKLM\Software\MyCo\MyApp\Timeout
    Deletes the registry key Timeout and its all subkeys and values

  REG DELETE \\ZODIAC\HKLM\Software\MyCo /v MTU
    Deletes the registry value MTU under MyCo on ZODIAC

2008-3-11 14:20
查看资料  发短消息 网志   编辑帖子  回复  引用回复
5872169
高级用户





积分 959
发帖 474
注册 2007-10-25
状态 离线
『第 3 楼』:  

我想删除HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{1171A62F-05D2-11D1-83FC-00A0C9089C5A}\InprocServer32下默认键值,但删除时提示无法删除所有指定的值!好象有权限,我想修改权限删除,不知道怎么修改!

2008-3-11 14:23
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
abcd
银牌会员





积分 1436
发帖 739
注册 2007-10-11
状态 离线
『第 4 楼』:  

please search the word "regini"  or "setacl"

2008-3-11 15:07
查看资料  发短消息 网志  OICQ (470237592)  编辑帖子  回复  引用回复
5872169
高级用户





积分 959
发帖 474
注册 2007-10-25
状态 离线
『第 5 楼』:  

4楼可以解释一下你的代码的意思吗?

2008-3-11 15:22
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复
HAT
版主





积分 9023
发帖 5017
注册 2007-5-31
状态 离线
『第 6 楼』:  



  Quote:
Originally posted by 5872169 at 2008-3-11 03:22 PM:
4楼可以解释一下你的代码的意思吗?

4楼的“代码”还是我来解释吧:)

  Quote:
使用方法:
regini regset.ini

regset.ini内容
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run [17]
把run项设为只允许system控制 其他用户不可控制 [17] 为控制参数 其他参数看下面的帮助

usage: REGINI [-m machinename | -h hivefile hiveroot | -w Win95 Directory]
[-i n] [-o outputWidth]
[-b] 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. [8 4 17]). 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



  Quote:
setacl CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /registry /deny administrator /full
rem 解释:
rem setacl:设置   -----------------------------   
rem CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run: 当前用户注册表分支启动RUN键值
rem registry:类型为注册表
rem deny:项目为拒绝访问
rem administrator:访问对象为administrator
rem full:权限是:完全访问
rem 简单的讲这句话的意思就是:
rem 将注册表HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run键值设置为administrator用户无法访问
rem 项目有四种 deny(拒绝) grant(允许)  set(设置) revoke(撤消)
rem 权限有两种 FULL 完全访问 READ 只读访问
rem 所以我们要恢复上面被拒绝的项只需要用一下下面的命令:
rem setacl CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /registry /grant administrator /full
rem 下面是各个主分支开头部分的对照:
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



2008-3-11 20:44
查看资料  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: