Category:VBS

  • The vbscript code that reads the Access database is packaged and downloaded

    Time:2019-10-23

    The effect is shown as follows:Core code: Copy the codeThe code is as follows: Option Explicit Dim arrTables( ), i, idxTables, intValidArgs Dim blnContent, blnFieldNames Dim objConn, objFSO, objRS, objSchema Dim strConnect, strHeader, strOutput Dim strFile, strResult, strSQL, strTable Const adSchemaTables = 20 ‘ Check command line arguments With WScript.Arguments If .Unnamed.Count = 1 Then […]

  • Vbs script code for network interface utilization monitoring (Windows)

    Time:2019-10-21

    Copy codeThe code is as follows: ‘program name: btlwchk · netinterface.vbs“Program purpose: monitoring the utilization of windows host network interface‘created on: September 1, 2011‘author information: zhangkai‘running environment: vbs‘process parameters MonSubject=”NetInterface” Set Args=WScript.Arguments If (Args.Count<1) Then Wscript.Echo MonSubject & ” -1:command line error” WScript.Quit(3) End If strcid=Args(0) ‘get working directorytmparr=Split(Wscript.ScriptFullName,”\”,-1) g_strworkdir=tmparr(0) narr=UBound(tmparr,1) For i=1 to narr-3 […]

  • Reading function code of Excel file with vbs

    Time:2019-10-20

    Core code Copy codeThe code is as follows: Function ReadExcel( myXlsFile, mySheet, my1stCell, myLastCell, blnHeader ) ‘ Function : ReadExcel ‘ Version : 2.00 ‘ This function reads data from an Excel sheet without using MS-Office ‘ ‘ Arguments: ‘ myXlsFile [string] The path and file name of the Excel file ‘ mySheet [string] The […]

  • VBS code to get information from XML file

    Time:2019-10-19

    Copy codeThe code is as follows: ‘***************************************************************** ‘** Script: getxmlelement.vbs ‘** Version: 1.0 ‘** Created: 1/8/2009 10:58PM ‘** Author: Adriaan Westra ‘** E-mail: ‘** Purpose / Comments: ‘** Get an element from a xml file ‘** ‘** ‘** Changelog : ‘** 1/8/2009 10:58PM : Initial version ‘** ‘***************************************************************** Dim objXML ‘ object to hold the […]

  • VBS code of saving information to an XML file

    Time:2019-10-18

    This script demonstrates how to save information to a xml file with the use of MSXML. The example xml file is used for the photo album on the site. Copy codeThe code is as follows: ‘***************************************************************** ‘** Script: CreateXML.vbs ‘** Version: 1.0 ‘** Created: 01/12/2009 9:51PM ‘** Author: Adriaan Westra ‘** E-mail: ‘** Purpose / […]

  • VBScript registry operation implementation code (read write delete)

    Time:2019-10-17

    VBScript Code: Copy codeThe code is as follows: ‘ Create a WSH Shell object: Set wshShell = CreateObject( “WScript.Shell” ) ‘ ‘ Create a new key: wshShell.RegWrite “HKCU\TestKey\”, “” ‘ Create a new DWORD value: wshShell.RegWrite “HKCU\TestKey\DWordTestValue”, 1, “REG_DWORD” ‘ Create a new subkey and a string value in that new subkey: wshShell.RegWrite “HKCU\TestKey\SubKey\StringTestValue”, “Test”, […]

  • WMI stdregprov implements code (local or remote) through VBScript of WMI operation registry

    Time:2019-10-16

    Because of its length, only the code for the function itself is shown on this page. The demo script that shows how to use this function is available as a separate download. Copy codeThe code is as follows: Function ReadRegValue( myComputer, myRegPath, myRegValue ) ‘ This function reads a value from the registry of any […]

  • Bookfind obtains the title of the book connected to the author’s VBS code by ISBN serial number

    Time:2019-10-15

    Core code: Copy codeThe code is as follows: If WScript.Arguments.UnNamed.Count <> 1 Then Syntax If WScript.Arguments.Named.Count > 1 Then Syntax blnTd = False If WScript.Arguments.Named.Count = 1 Then If UCase( WScript.Arguments.Named( 0 ) ) = “/TD” Then blnTd = True Else Syntax End If End If strISBN = WScript.Arguments.UnNamed( 0 ) strPgTitle = TitleFromHTML( “http://www.amazon.com/gp/product/” […]

  • VBS script and BAT batch processing method to delete itself

    Time:2019-10-14

    VBS script and BAT batch self-deletion method (suicide)Delete oneself: VBSSave the following script as selfkill. VBS or selfkill. vbe: Copy codeThe code is as follows: Set fso = CreateObject(“Scripting.FileSystemObject”) f = fso.DeleteFile(WScript.ScriptName) WScript.Echo( WScript.ScriptName) And then run it, did you find that selfkill. VBS magically disappeared? And the back dialog box is displayed normally.^*^The script […]

  • Internal Implementation of VBS String

    Time:2019-10-13

    Recently, there has been much discussion on truncation of VBS string Chr (0). It seems necessary to introduce the internal implementation of VBS string. Demon Friendship Tip: This article needs some C language and Windows programming knowledge, VBScript beginners are careful to enter. VBS is based on Microsoft ActiveX/COM technology. In order to support any […]

  • The origin of Chr (0) in ASP / VBScript and the analysis of its security problems

    Time:2019-10-12

    This character marks the end of the string, also known as null-terminated. This brings some trouble to scripting, especially ASP programming. Many people may ask why we want to keep this special character. We can trace it back to C language, one of the languages of operating system. Children who have learned C/C++ may know […]

  • MultiLine property of VBS regular expression object

    Time:2019-10-11

    In the Backreferences section of the chapter Introduction to Regular Expressions (Introduction to Regular Expressions): Copy codeThe code is as follows: ‘Using the regular expression shown above, the following JScript code can use sub-matching information to replace the same word twice in a text string with the same word:var ss = “Is is the cost […]