Tag:vbs

  • Windows can automatically run nodejs application in the background through VBS + bat

    Time:2021-12-6

    Environment: Windows 8.1 The principle is to run bat files through VBS windowless background 1. Create a new. Bat file. The contents are as follows: ? 1 2 3 4 @ECHO ON  f: cd \repositories\yyper start /b nodemon index.js -f 2. Create a new. VBS file. The contents are as follows: ? 1 2 Set […]

  • VBS enumerates processes VBS lists a detailed list of processes

    Time:2021-12-4

    Today I want to talk about using VBS (VBScript script) to enumerate the processes of Windows operating system. What is the use of this? For example, sometimes you want to monitor whether a process is running, which is very useful Example: Enumerating processes with vbs script ? 1 2 3 4 5 6 7 8 […]

  • VBS code for querying computer on-off time

    Time:2021-12-3

    Core code: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 strComputer = “.” Set objWMIService = GetObject(“winmgmts:” _ & “{impersonationLevel=impersonate}!\\” _ & strComputer & “\root\cimv2”) Set colLoggedEvents = objWMIService.ExecQuery […]

  • Modify the attribute of files ending with points to hide through vbs

    Time:2021-12-2

    Core code: ? 1 2 3 4 5 6 REM modify the attribute of a file ending with a dot to “hidden” @echo off set DstFile=C:\test\batcher. >”%temp%\FileProperty.vbs” echo Set objFSO = CreateObject(“Scripting.FileSystemObject”).GetFile(“\\?\%DstFile%.\”) >>”%temp%\FileProperty.vbs” echo objFSO.Attributes=objFSO.Attributes+1+2 cscript /nologo “%temp%\FileProperty.vbs”

  • VBS tutorial: objects – regular expression (regexp) objects

    Time:2021-12-2

    Regular expression (regexp) objectProvides simple regular expression support. explainThe following code illustrates the usage of regexp object: Function RegExpTest(patrn, strng) Dim regex, match, matches’ create variables. Set regex = new regexp ‘establish a regular expression. Regex. Pattern = pattern ‘sets the pattern. Regex.ignorecase = true ‘sets whether characters are case sensitive. Regex. Global = true […]

  • VBS tutorial: object err

    Time:2021-11-29

    Err Contains information about runtime errors. Accept the raise and clear methods used to generate and clear runtime errors. explain The err object is an inherent object with global scope: you don’t have to create an example of it in your code. Err’s properties are set by an error generator: Visual Basic, automatic object, or […]

  • Inside VBS Technology: detailed explanation of CreateObject function

    Time:2021-11-27

    Once I didn’t understand why passing different strings in the CreateObject function can create a variety of powerful objects. Later, I accidentally saw the [umu WSH tutorial] (9) CreateObject process of umu, and learned that the CreateObject function creates a COM object, and the first parameter is the progid of the COM object. Later, I […]

  • VBScript Basics – VBS variable definition and usage

    Time:2021-11-26

    1、 Declarative variable ① Explicit declaration: declared with dim, public and private statements ② Implicit declaration: use directly without declaration ③ Mandatory declaration: the option explicit statement forces all variables to be explicitly declared ? 1 2 3 4 5 6 7 8 9 10 11 dim name,age name=”Ethon” age=27 msgbox name & age   […]

  • Basic part of VBScript – definition and use of VBS array

    Time:2021-11-25

    vbsarrayDefinition and Usage ArrayReturns a variable that contains an array.Note: the first element in the array is zero. grammar Array(arglist)parameter   describearglist   Required. A comma separated list of element values in the array. example Example 1 ? 1 2 3 dim a a=Array(5,10,15,20) document.write(a(3)) Output: 20 Example 2 ? 1 2 3 dim a […]

  • VBS array in simple terms

    Time:2021-11-24

    VBS tutorial using arrays ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 REM definition dim arr(5)   REM assignment arr(0) = 20 arr(1) = 2 arr(2) = 5 arr(3) = 3 arr(4) = 1 arr(5) = 100   REM access msgbox(arr(2))   REM traversal […]

  • VBS Basics – const constants

    Time:2021-11-23

    constant: refers to the quantity whose value remains unchanged during program operation. It is used to save fixed values, strings and other constants. Constant definition: used in VBScriptConstDirective can create string or numeric constants whose names have a certain meaning and assign them literal values. ? 1 2 3 Const NAME = “Ethon” Const AGE […]

  • VBS basic chapter – Operator graphic explanation

    Time:2021-11-22

    VBSScript has a complete set ofoperator, including arithmetic operators, comparison operators, connection operators and logical operators.Operator priority: First calculate the arithmetic operator, then the comparison operator, and finally the logical operator. All comparison operators have the same priority, that is, the comparison operators are calculated from left to right. 1. Arithmetic operator 2. Comparison operator […]