在 VbScript 中绕过 UAC

编程入门 行业动态 更新时间:2024-10-25 07:25:31
本文介绍了在 VbScript 中绕过 UAC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个在用户注销时运行的 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-29 08:40:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1186717.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:VbScript   UAC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!