Tag:vbscript

  • VBScript encapsulates MS OWC (2)

    Time:2020-4-8

    Copy codeThe code is as follows: ”OWC1.VBS class owc private o ‘incoming objectpublic sub create(id_,width_,height_,location_) Set o = document.createElement(“object”) o.setAttribute “id”,id_ o.setAttribute “classid”,”CLSID:0002E55D-0000-0000-C000-000000000046″ o.setAttribute codebase=”owc11.dll” o.style.width=width_ o.style.height=height_ document.getElementById(location_).appendChild(o) end sub ‘draw rectangleThe background color of a chartTitle of ‘chartcaption’ chart‘chartcaption’ fontcolor ‘chart title color‘interior ABCD color ABCD fill color in rectangle‘caption’‘categories’ name array‘values’ array stringpublic […]

  • The code of VBScript three numbers comparison

    Time:2020-3-29

    Copy codeThe code is as follows: dim a,b,c A = InputBox (“please enter an integer of 0-99 and do not repeat, let alone use Chinese characters and letters”)B = InputBox (“please enter an integer of 0-99 and do not repeat, let alone use Chinese characters and letters”)C = InputBox (“please enter an integer of 0-99 […]

  • “& H” in VBScript statements is dedicated to hexadecimal number representation

    Time:2020-3-7

    In VBScript statements “& H” was used for hexadecimal numbers. When using “&” for string connection, a space should be added on both sides. Although it is normal to run without space in most cases, it is not correct or standard. When a field begins with the letter “H”, if there is such a statement: […]

  • VBScript calling WebService implementation code

    Time:2020-2-17

    Copy codeThe code is as follows: ‘get the initialized soap objectPublic Function GetSoapClient(sURL) Dim oSoap Set oSoap = CreateObject(“MSSOAP.SoapClient”) oSoap.mssoapinit sURL Set GetSoapClient = oSoap End Function ‘user binding corresponding serial numbersub BindCodeNumber() Dim oSoap Dim sURL dim str sURL = “” ‘sURL =”” Set oSoap = GetSoapClient(sURL) ‘str = oSoap.HelloWorld() Set oSoap = Nothing […]

  • Summary of VBScript common functions

    Time:2020-2-10

    Here is a summary of the commonly used functions and their usage in VBScript.   1,GetROProperty Note: you use the GetROProperty method to retrieve the current value of a test object property from a run-time object in your application In general, all objects can use this method to get the actual value of the runtime object. […]

  • Collect system information with VBScript and upload it to FTP space

    Time:2020-1-8

    Before boring, I sorted out a copy of this thing, because when the company allocates computers to new employees, it needs to register the equipment once, but it’s very troublesome to check every time. As a result, the following vbs script was born, but it’s a pity that the script is well done, but it […]

  • Debugging JavaScript / VBScript script (ie)

    Time:2019-12-9

    Both of these methods can be debugged by using visual studio. First, you can see the debugging of Web script programs that are frequently used:1. To debug the script program in the web page, the debugger needs the host program – here is ie support. In fact, all script program interpreters implement a com debugging […]

  • Generate SDDL function of VBSCript (permission setting)

    Time:2019-8-19

    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=’”& StrSID &”‘”)  Set ObjTru = ObjWMI.Get(“Win32_Trustee”).SpawnInstance_() ObjTru.Domain  = ObjSID.ReferencedDomainName ObjTru.Name   = […]

  • The Method of Obtaining CPU Utilization Rate by VBScript

    Time:2019-6-24

    VBScript gets CPU usage code through WMI In Du Niang, the search keyword “WMI CPU usage” is “python uses WMI monitoring system – CPU usage rate”. Needless to see, it must be collected again. Python is powerful, but calling WMI is still “authentic” with VBS. On Error Resume Next strComputer = “.” Set objWMIService = […]

  • VBScript version of PHP extract () function

    Time:2019-5-28

    As we all know, PHP has a very convenient extract (), which can easily convert dictionary into variables. Of course, there are many constraints to ASP, especially VBScript script. This article describes a conversion idea, which can achieve similar functions. Now I will provide the extract code of ASP version directly. Copy codeThe code is […]

  • BAT batch processing, VBScript batch installation font script sharing

    Time:2019-4-30

    According to the requirements of the new system, it is often necessary to deploy some fonts that are not available in the original system. Originally, I often asked users to install font files manually for the sake of simplicity. Although the usability of Windows is quite good, we still need to take care of some […]

  • Summary of Common Operation of Excel Report Generation by Vbscript

    Time:2019-4-27

    After the completion of automated testing with QTP, it is often necessary to write the test results into Excel. Here, some commonly used methods of Excel operation are summarized and sorted out for easy use and reference. Office Excel 2003 version is supported, and 2007 version is not supported. Vbscript code On Error Resume Next […]