调用XCACLS.vbs修改权限问题,请教.(已解决)
本帖最后由 dearmb 于 2011-1-21 15:46 编辑我看vbs的脚本,就是在cscript下执行E:\Scripthost\XCACLS.vbs 加参数
AU3,也是RunWait("cscript E:\Scripthost\XCACLS.vbs ……
objShell.Run("和RunWait("的内容应该是一样的阿
为什么一个成功一个不成功呢
=========================================================
这里是运行vbs脚本,修改权限成功,vbs的内容如下:
Set objShell = CreateObject("Wscript.Shell")
objShell.Run("cscript E:\Scripthost\XCACLS.vbs D:\EntrySystems\line6_G\Dictionary /g administrators:f /g system:f /g administrator:f /g ""operator checker group"":123456789B;123456789B /g ""operator group"":123456789B;123456789B /g ""operator supervisor group"":123456789B;123456789B/g ""operator1 group"":123456789B;123456789B /f /t")
=========================================================
下面是AU3,修改权限失败,administrators,system,administrator以外的组被删掉了,AU3的内容如下:
$Permissions=IniReadSection ($INIPath, "PermissionsChange" );获取字段名PermissionsChange中的所有关键字
For $i = 1 To $Permissions;循环关键字
RunWait($Permissions[$i]);运行修改権限脚本
Next
_FileWriteLog(@ScriptDir & "\updata.log","権限修改完成");记录権限修改完成
INI配置文件如下:
Permissions1=cscript E:\Scripthost\XCACLS.vbs D:\EntrySystems\Line6_G\Dictionary /g administrators:f /g system:f /g administrator:f /g ""operator checker group"":123456789B;123456789B /g ""operator group"":123456789B;123456789B /g ""operator supervisor group"":123456789B;123456789B/g ""operator1 group"":123456789B;123456789B /f /t 本帖最后由 dearmb 于 2011-1-21 07:46 编辑
这是用vbs执行的结果,红色部分是正常的,修改权限成功
Starting XCACLS.VBS (Version: 5.2) Script at 2011-1-21 7:12:43
Startup directory:
"E:\Scripthost"
Arguments Used:
Filename = "D:\EntrySystems\line6_G\Dictionary"
/F (All Files under current directory)
/T (Traverse Directories)
/G (Grant rights)
administrators:F
system:F
administrator:F
operator checker group:123456789B;123456789B
operator group:123456789B;123456789B
operator supervisor group:123456789B;123456789B
operator1 group:123456789B;123456789B
- Changing /G user/group: "administrators" to "BUILTIN\Administrators"
- Changing /G user/group: "system" to "NT AUTHORITY\SYSTEM"
- Changing /G user/group: "administrator" to "ABPC3360\Administrator"
- Changing /G user/group: "operator checker group" to "ABPC3360\operator checke
r group"
- Changing /G user/group: "operator group" to "ABPC3360\operator group"
- Changing /G user/group: "operator supervisor group" to "ABPC3360\operator sup
ervisor group"
- Changing /G user/group: "operator1 group" to "ABPC3360\operator1 group"
************************************************************************
这是用au3执行的结果,红色部分组都没了,组没了,所以修改权限失败
Starting XCACLS.VBS (Version: 5.2) Script at 2011-1-21 7:13:12
Startup directory:
"D:\"
Arguments Used:
Filename = "D:\EntrySystems\Line6_G\Dictionary"
/F (All Files under current directory)
/T (Traverse Directories)
/G (Grant rights)
administrators:F
system:F
administrator:F
group:123456789B;123456789B
group:123456789B;123456789B
group:123456789B;123456789B
group:123456789B;123456789B
- Changing /G user/group: "administrators" to "BUILTIN\Administrators"
- Changing /G user/group: "system" to "NT AUTHORITY\SYSTEM"
- Changing /G user/group: "administrator" to "ABPC3360\Administrator"
Can't find Account: "ABPC3360\GROUP"
Could not find /G user/group: "group" removing from list.
Can't find Account: "ABPC3360\GROUP"
Could not find /G user/group: "group" removing from list.
Can't find Account: "ABPC3360\GROUP"
Could not find /G user/group: "group" removing from list.
Can't find Account: "ABPC3360\GROUP"
Could not find /G user/group: "group" removing from list.
************************************************************************
绿色部分的Startup directory:不一样,但是我把我的脚本放到E:\Scripthost下执行,Startup directory内容一样了
但是修改权限还是失败 $INIPath="d:\config.ini"
$Permissions=IniReadSection ($INIPath, "PermissionsChange" );获取字段名PermissionsChange中的所有关键字
For $i = 1 To $Permissions;循环关键字
MsgBox(0,"",$Permissions[$i])
RunWait($Permissions[$i]);运行修改権限脚本
Next
RunWait("cscript E:\Scripthost\XCACLS.vbs D:\EntrySystems\line5\settings /g administrators:f /g system:f /g administrator:f /g ""operator checker group"":123456789B;123456789B /g ""operator group"":123456789B;123456789B /g ""operator supervisor group"":123456789B;123456789B/g ""operator1 group"":123456789B;123456789B /f")
直接runwait就好使,读取INI的就不好使,但变量内容一样啊
页:
[1]