标题: 注册表权限问题
[打印本页]
作者: xmiou
时间: 2007-3-27 08:24
标题: 注册表权限问题
大家好,小弟在测试批处理注册表权限时发现:调用SETLOCAL修改注册表权限时,
@setacl machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /registry /grant everyone /read /p:no_dont_copy 能够防止RUN下建文件,但,同样:
@setacl CLASSES_ROOT\exefile\shell\open\command /registry /grant
everyone /read /p:no_dont_copy 下却无效,
小弟我已给到论坛搜索 里找过相应的资料没找到,希望哪位好心人能够帮帮我怎样对键值设置权限.
小弟在线等哦
作者: dikex
时间: 2007-3-27 08:39
打错了?
CLASSES_ROOT应该为HKEY_CLASSES_ROOT吧……
未测试,不知输入正确后是否能成功
作者: xmiou
时间: 2007-3-27 09:07
没打错,前面还有个:@rem HKLM
作者: xmiou
时间: 2007-3-30 22:48
郁闷,看来高手都不屑回答这个问题/.我等了很久了,好失望,我给出具体点吧,以下是代码,.我的问题是为什么第一部分能够成功,而第二.三部分却不成功?希望高手指点:
:Selection
@rem User Choice
@echo.
@echo 请输入以下选项前面的数字
@echo.
@echo 1: 安装保护
@echo 2: 恢复默认设置
@echo.
@set /p UserSelection=输入您的选择(1、2、3、4)
@if "%UserSelection%"=="1" goto install
@if "%UserSelection%"=="2" goto uninstall
@if "%UserSelection%"=="3" goto information
@if "%UserSelection%"=="4" goto quit
@rem 输入其他字符
@cls
@goto Selection
:information
@pause>nul 2>nul
@cls
@goto Selection
:install
@set OP=/grant everyone /read /p:no_dont_copy
@goto Doit
:uninstall
@set OP=/revoke everyone /read /p:yes
@goto Doit
:Doit
@echo.
@echo 正在执行操作...
@rem HKLM(第一部分)
@setacl machine\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /registry %OP%>nul 2>nul
@setacl machine\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /registry %OP%>nul 2>nul
@setacl machine\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices /registry %OP%>nul 2>nul
@setacl machine\SOFTWARE\Microsoft\Windows\CurrentVersion\RunEX /registry %OP%>nul 2>nul
@setacl machine\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEX /registry %OP%>nul 2>nul
@setacl machine\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServicesEx /registry %OP%>nul 2>nul
@rem HKCU(第二部分)
@setacl CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /registry %OP%>nul 2>nul
@setacl CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /registry %OP%>nul 2>nul
@setacl CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices /registry %OP%>nul 2>nul
@setacl CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunEX /registry %OP%>nul 2>nul
@setacl CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEX /registry %OP%>nul 2>nul
@setacl CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServicesEx /registry %OP%>nul 2>nul
@setacl CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServicesOnce /registry %OP%>nul 2>nul
@rem USERS(第三部分)
@setacl USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /registry %OP%>nul 2>nul
@setacl USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /registry %OP%>nul 2>nul
@setacl USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices /registry %OP%>nul 2>nul
@setacl USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunEX /registry %OP%>nul 2>nul
@setacl USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEX /registry %OP%>nul 2>nul
@setacl USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServicesEx /registry %OP%>nul 2>nul
@setacl USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServicesOnce /registry %OP%>nul 2>nul
[
Last edited by xmiou on 2007-3-30 at 10:54 PM ]
作者: slore
时间: 2007-3-31 03:15
:@rem HKLM只是注释用的。
我这里没有setacl你最好看清楚他的路径要如何表示。
作者: xmiou
时间: 2007-3-31 23:13
我有这个setacl,只要把它放在同一目录下便可,就是不明白为什以第一部分能成功.其它部分不能成功.
作者: slore
时间: 2007-4-1 00:11
machine你注意了没,是setacl的用法上的问题
作者: xmiou
时间: 2007-4-4 11:10
请问machine能用,为什么CURRENT_USER,USER这些又不能用,应刻改为什么啊?谢谢提示