创建脚本对象失败,,检查系 统是否禁用了VBS脚本权限。。。。。。。怎么弄啊,?是什么意思。。

2024-12-16 17:20:33
推荐回答(1个)
回答1:

Dim objOS '在系统为Win7或Vista时提升VBS脚本权限
For Each objOS in GetObject("winmgmts:").InstancesOf("Win32_OperatingSystem")
If InStr(objOS.Caption,"XP") = 0 Then
If WScript.Arguments.length = 0 Then
Dim objShell
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", Chr(34) &_
WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1
End If
End If
Next