在 VbScript 中绕过 UAC [英] Bypass UAC in VbScript

查看:42
本文介绍了在 VbScript 中绕过 UAC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在用户注销时运行的 Vbscript,它假设关闭服务,但是我无法关闭该服务,因为它被 UAC 阻止.我想知道是否有办法在我的 vbscript 中绕过 UAC,而不必在我的域中的每台机器上关闭 UAC.谢谢!

I have a Vbscript that runs on user log off that is suppose to turn off a service, however i't can't turn off the service since it's being blocked by UAC. I was wondering if there is a way to bypass UAC in my vbscript instead of having to turn off UAC on every machine in my domain. thanks!

推荐答案

如果你能绕过 UAC,说它不应该适用于我",那么 UAC 的意义何在?你不能从 vbscript 绕过它.

What would be the point of UAC if you could bypass it by saying "it shouldn't apply to me"? You cannot bypass it from vbscript.

可以以管理方式执行此操作,首先使用提升的凭据运行脚本.

You can do this administratively though, by running the script using elevated credentials in the first place.

例如通过登录时"计划任务,以管理员或系统身份运行.我相信这适用于 Windows 7 和 vista.

For example by having an "on logon" scheduled task, running as Administrator or SYSTEM. I believe this works in Windows 7, and vista.

要在远程机器上创建这样的任务:

To create such a task on a remote machine:

schtasks.exe /create /S COMPUTERNAME /RU "NT AUTHORITY\SYSTEM" /RL HIGHEST /SC ONLOGON /TN "Administrative OnLogon Script" /TR "cscript.exe \"Path\To\Script.vbs\""

也可以使用脚本创建任务.

Tasks can also be created using script.

注意:如果这是脚本唯一要做的事情,您可以简单地使用像 SCNET STOP 这样的命令来停止直接服务.

Note: If this is the only thing the script does, you can simply use a command like SC or NET STOP to stop the service directly.

这篇关于在 VbScript 中绕过 UAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆