In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces VBS and UAC how to achieve account control, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Although many people think this feature is a chicken rib, from VBS's point of view, UAC is more or less useful. Under the restriction of UAC, double-clicking the VBS file directly can only run under standard user permissions, and many things cannot be done, such as copying itself to the windows folder, or writing the boot key to the registry, and so on. Storm No. 1 virus, which is very rampant under XP, can only change the folder properties to hidden under Win7, and nothing else can be done. Of course, some students who don't know the truth like to turn off the UAC function and install the so-called security software called 359 or 361. I don't say much either, or I'll be surrounded.
Double-click the VBS file system will not automatically pop up UAC window is a big problem, because this greatly limits the function of VBS, a lot of things can not be done, how to solve it? Please look at the following code
The code is as follows:
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
Else
Call Main ()
End If
Else
Call Main ()
End If
Next
Sub Main ()
MsgBox "UAC demon"
End Sub
I rewrote this according to the code of this website to judge the system version. If it is XP (ordinary users are usually XP, if it is 2003, please rewrite it yourself), then run the code directly, otherwise, call the ShellExecute method of the Shell.Application object to run the script with administrator privileges. In this way, our VBS program can do whatever it wants in Vista/Win7 as it does in XP.
Thank you for reading this article carefully. I hope the article "how to achieve account Control with VBS and UAC" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.