In vbs, how does one obtain the maximum value position in an array?
The following vbs script can implement this function:
Public Function getarrmaxvalueindex (byval ARR)Dim IX, ixmaxIxmax = 0For IX = 1 to ubound (ARR)If (ARR (ixmax) Ixmax = IXEnd ifNextGetarrmaxvalueindex = ixmaxEnd Function
'Define array and index for Max entryDim arr, ixmax'Initialize the ArrayArr = array (4, 1, 8, 6, 3, 6)'Get the inde
Use the. vbs script, that is, the SCRIPT file, to modify the registry. If your machine does not support VBSCRIPT, read the second part. The following example is used to explain the script file:
Windows Script Host Sample Script
You have a maid-free right to use, modify, reproduce and distribute
The Sample Application Files (and/or any modified version) in any way
You find useful, provided that you agree that Microsoft has no warranty,
Obligations or l
Save the file as a T. vbs file as prompted. Enter the cscript T. vbs [parameter] In the CMD window.
If you want to port to VB, replace wscript. Echo With Debug. Pring or other output functions.
'Function:'List all process or kill one of them'Parameter:Nameorpid process's name or PID'Return:'True if kill one process, else falseFunction killprocess (nameorpid)Dim owmi, oprocs, oproc, strsqlKillprocess = fals
In the vbs implementation drop-down box, the corresponding value is selected from the gu1dai Blog
Enter a value in the drop-down box of the keyword vbs.
Select the table: Tableame:
I don't know whether it was recently or before. In the past few days, I often saw a vbs In the QQ group.
Code .
Copy code The Code is as follows: Set wshshell = wscript. Createobject ("wscript. Shell ")
Wshshell. appactivate "group-Powers member communication"
For I = 1 to 10' the number of requests to be sent
Wscript. Sleep 500 'message sending Interval
Wshshell. sendkeys "^ V" 'content to be sent
Wshshell. sendkeys I 'here, each message is differe
Splitfile. vbs'/* =================================================== =========================================='* Intro. TXT text cutter. The default value is 8000 characters, which is partitioned into one file. Drag is supported.'* Filename splitfile. vbs'* Author yongfa365'* Version V1.0'* Madetime 2008-04-24 12:58:43'* Lastmodify 2008-04-24 12:58:43'* ====================================================
Usage: 'Use: cscript this. vbs> dic.txtSet the followingCodeSave as this. vbs
Copy codeThe Code is as follows: a = array (1, 2, 3, 4, "")
Function JS1 (N)
For I = 1 to n
F = F "F" I ""
S = S "for each F" I "in A: wscript. Echo" F
S = mid (s, 1, Len (S)-1 )":"
Next
JS1 = s
End Function
Function JS2 (N)For I = 1 to nM = M "Next "":"NextJS2 = mEnd Function
LCX = JS1 (ubound (A) + 1) JS2 (u
First, create a text file and enter the following information:
CopyCode The Code is as follows: on error resume next
Dim vol_prod_key
If wscript. Arguments. Count Vol_prod_key = inputbox ("powered by www.jb51.net" vbcr "
Program The serial number of your current windows will be automatically replaced, and the full genuine version will be verified by Microsoft. " Vbcr " serial number (invalid for OEM, XP vlk by default): "," Windows XP serial number auto changer "," MRX3F-47B9T-2487J-KWKMF-RPW
from synflood attacks. Synfoold has always been a constantly changing fake IP address, and the IP addresses of CC attacks are all real IP addresses, which are basically unchanged. As long as we use security policies to block all these IP addresses, we can.
I have read the methods described by some netizens, but the attack IP address is usually several thousand different IP addresses. It is too troublesome to manually seal an IP address. Next we use
Program To automatically block these IP addre
Vbs string and date-related functions
Recently, I used date format conversion when writing ASP programs. Because different databases have different requirements on date formats, I have found some relevant information here. I hope it will be helpful to you. If you have any questions, please leave a message, thank you! 1. ASC (x), CHR (x): conversion character, Character Code 2. filter: search for specific string formats in the string array: V = filter
In vbs, if the program to be run contains spaces, errors are often prompted in the usual way. In fact, there are two different solutions:
Add three double quotes before and after the application. The Code is as follows:
[C-sharp] View plaincopyprint?
Set wshell = Createobject ("wscript. Shell ")
Wshell. Run "" C:/program files/360/360 SE/360se.exe ", 5, true
Set wshell = nothing
Set wshell = Createobject
) in the elementary age. Note that there is a "big" for, and a small.
After a small for execution cycle, a large for execution is performed once (in other words, a large for execution is performed once, and a small for execution is performed 9 times ).
Once. In the big for, you can add more than a small for statement. Let's modify the source program:
Dim I, jFor I = 1 to 9For I = 1 to 9Str = str I * j ""Next 'Each next corresponds to aStr = str vbCrlf 'vbcrlf is equivalent to the Enter key on
I hope I can find a VBS code that can save the excel table as TXT. Although I can save it as a choice, I still need to directly run VBS to save it as TXT. How should I write the code?
If Excel is installed, it will be relatively simple. The following is a common tool that can run without Office, as shown below:VBScript code:Copy codeThe Code is as follows: Set oShell = CreateObject ("Shell. Application ")S
Pack. vbs is used to package folders. The root directory is the directory where the files are located.
Copy codeThe Code is as follows: Dim n, ws, fsoX, thePath
Set ws = CreateObject ("WScript. Shell ")
Set fsoX = CreateObject ("Scripting. FileSystemObject ")
ThePath = ws. Exec ("cmd/c cd"). StdOut. ReadAll ()"\"
I = InStr (thePath, Chr (13 ))
ThePath = Left (thePath, I-1)
N = len (thePath)
On Error Resume Next
AddToMdb (thePath)
Wscript. Echo "the cu
Baidu is so arrogant that it always eats the first line of space, resulting in no code indentation. You can use the following methods to solve the problem:
1. Switch to the classic version of Baidu Post Bar
2. Use the following script to replace the tabs and spaces in the Code with the unicode encoding format.
Copy codeThe Code is as follows: 'cscript // nologo C: \ test. vbs C: \ test. bat
Set objFSO = CreateObject ("Scripting. FileSystemObject "
Copy codeThe Code is as follows: '==============================================
'Sendkeys in VBS simulate keyboard keys
'2013-26
'Liu Lin
'==============================================
Dim WshShell
Set WshShell = WScript. CreateObject ("WScript. Shell ")
WshShell. Run "cmd"
'Wait the script for 1000 milliseconds, that is, 1 second before executing the next statement.
WScript. Sleep 1000
'-- When sending characters, the input method must be in the En
Implementation features: Use VBS to retrieve messages for a title in Outlook local mailbox today.The code is as follows:ConstC_date_format_mail_filter_from =1 'yyyy-m-d 0:00 AMConstC_date_format_mail_filter_to =2 'yyyy-m-d 11:59 PMFunctionCheckmail (Pmailfolder, Pmailtitle) on Error Resume Next DimObjolappDimobjNameSpaceDimobjfolderDimstrfilter Checkmail=False SetObjolapp =CreateObject("Outlook.Application") SetobjNameSpace =
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.