The script should have the following features:
1. Automatic Start;
2. Copy all files and folders of the USB flash drive to the specified location on a regular basis;
3. No error message (critical, if you don't want to find it ).
The idea is very simple. Next we will talk about the specific content of the script. I have added comments after each line of script. I hope this will be easier for me to understand.
Copy codeThe Code is as follows: On Error Resume Next 'ignore the exception; otherwise,
So I studied it for a while. Write a rough DEMO.
Exe2hex. vbs // exe2vbs written by xiaolu. I changed it to direct drag-and-drop and convert it to hexadecimal
========================================================== ==========
Copy codeThe code is as follows: 'Code by xiaolu
'Change by NetPatch
On error resume next
Set arg = wscript. arguments
If arg. count = 0 then wscript. quit
Do while 1
Fname = arg (0)
Err. number = 0
Set Ado = CreateObject ("ad
The first code will use the program associated with the default mp3 file, and a music playing Box will appear.
Copy codeThe Code is as follows: wscript. sleep 12000
Set ws = createobject ("wscript. shell ")
Ws. run "Brother, you're exhausted"
The second section of the Code calls the wmplayer.ocxplug-in, which does not appear in the music box. If you want to close the music plug-in, you can close the wscript.exe process.Copy codeThe Code is as follows: Dim wmpSet wmp = CreateObject ("WMPlayer. OC
I was planning to write it myself, but it would be hard to get rid of complicated algorithm descriptions. Forget it. If there are ready-made COM Object calls, why bother with algorithms? Just use them directly. If the following example code prompts that an object cannot be created, you need to download the CAPICOM component and register it.
Copy codeThe Code is as follows: Const CAPICOM_HASH_ALGORITHM_MD2 = 1
Const CAPICOM_HASH_ALGORITHM_MD4 = 2
Const CAPICOM_HASH_ALGORITHM_MD5 = 3
Const CAPICOM
I think it is awesome to read the title. I have heard that I can use PHP to send text messages (fetion) and Python to implement PyFetion to send text messages (fetion ). I have also read the corresponding PHP and Python source code. The implementation is still complicated. Can I use VBS for implementation?
After seeing the code, I felt that the code was actually implemented using the interface above 10086.cn (Mobile official website). Has the officia
Today, the boring stroll a search to ask, to find such a problem:
Who can provide a detailed procedure for the factorial of 20 in the VBS
Here are some answers to this:
Copy Code code as follows:
function JX (x)
J=1
For i=2 to X
J=j*i
Next
Jx=j
End Function
MsgBox Jx (20)
Run the above program and output 2.43290200817664E+18. Laughing without words, once again proved my previous conclusion, in this site to answe
VBS actually has two types of identifiers:
Generic identifier (Normalidentifier)
Bracket identifier (bracketidentifier)
But all the VBS books I've seen are just plain identifiers, without the bracket identifiers.
Rules for common identifiers we are already familiar with:
The first character must be a letter.The characters that follow can be letters, numbers, and underscores (_)
Length cannot exceed 2
Originally intended to write their own, but see the complexity of the algorithm described on the shrink. Forget it, there are ready-made COM object calls, why to care about the algorithm, directly to use on the line. If the following example code prompts you not to create an object, you need to download the CAPICOM component and register it.
Copy Code code as follows:
Const CAPICOM_HASH_ALGORITHM_MD2 = 1
Const CAPICOM_HASH_ALGORITHM_MD4 = 2
Const CAPICOM_HASH_ALGORITHM_MD5 =
First we look at an example of an input letter:
Copy Code code as follows:
Set S = WScript.CreateObject ("Wscript.Shell")
App=s.run ("C:\windows\notepad.exe")
Code= "Biweilun"
Wscript.Sleep 1000
S.appactivate app
S.sendkeys Code
Wscript.Quit
This VBS will SendKeys method friends know, the role is to open a notepad, and then "Biweilun" this string of characters into, of course, you can replace the code parameter CHR (
End If
Next
If Complete=ubound (arrhttp) +1 Then Exit do
Timeout=timeout+1
If timeout=5*30 Then
' Set according to file size
MsgBox "30 Seconds Timeout!" "
Wscript.Quit
End If
Loop
If FSO. FileExists (filepathfilename) Then fso. DeleteFile (Filepathfilename)
Fso. DeleteFile (filepath "Tmpfile")
Ado. SaveToFile (Filepathfilename)
MsgBox "File Download complete!" "
Function getfilename (URL)
Arrtmp=split (URL, "/")
Getfilename=arrtmp (UBound (arrtmp))
End Function
Function
Because the editor filters some characters, such as Ampersand, the following script may run incorrectly. Reader add this character is OK.
The function of the VBS script is many, but sometimes we only need some of these features, today I suddenly want to study how to use the VBS script implementation to add programs to the self starter ...
Let's start with a paragraph ...
Copy Code code as follows:
parameter is a variable that you define when you define a function, which is used to "catch" the passing
The amount that comes over, such as function Co (T1,T2) T1,T2 is the formal parameter.
In VBScript, parameter passing is a value, not an address (do not understand it does not matter, learn the C language pointer you understand), so we carry on the participation
The number pass is actually a variable assignment, such as we call Co (A1,A2), and in fact the program does one step: t1=a1,t2=a
In a certain time, to run a regular ASP file to perform a task, such as a factory at 9 o'clock in the morning to collect all the meter readings, of course, through in-SQL connection to the various meters, we are now using an ASP file to the table in the SQL of the reading again to focus on MS SQL.
There are a number of ways you can see the timing of running ASP files, but what I'm going to say now is an easy way to make use of a scheduled task to do it easily.
First, you have to write a JS or
File actions
Copy Code code as follows:
Set FSO = WScript.CreateObject ("Scripting.FileSystemObject") ' Creates file system objects to work with drives, folders, and files
Set WshShell = WScript.CreateObject ("Wscript.Shell") ' Creates system Shell objects to run programs and so on
If Fso.fileexists ("D:\ Sword Online\alreadyexist.txt") Then ' if found file ' D:\ Sword online\alreadyexist.txt '
Wshshell.run ("D:\ Sword online\ Sword Online.exe") ' Run ' D:\ Sword online\ Swo
This article mainly introduces the code for vbs to obtain the current time and date. For more information about how to obtain the current date, see method 1:
Currentdate1 = date () msgbox Currentdate1
Method 2:
Currentdate2 = year (Now) "-" Month (Now) "-" day (Now) msgbox Currentdate2
Get current time:
CurrentTime = Hour (Now) ":" Minute (Now) ":" Second (Now) m = "Current Time" CurrentTime msgbox m
For more articles about
Source: CCID Author: smtk
Because VBS is easy to embed into webpages, more and more hackers use this method to spread Trojan viruses. When vbsvirus is detected, you can see the .vbs.exe file under Windows. The wscript.exe process exists in the system process, and the machine slows down, which is similar to other viruses. If you encounter this situation, you can use the following methods to scan and kill.
Step 1: Stop running wscript.exe. Click Start>
1. shutdown1.vbs ):Set coloperatingsystems = GetObject ("winmgmts: {(shutdown)}"). execquery ("select * From win32_operatingsystem ")For each objoperatingsystem in coloperatingsystemsObjoperatingsystem. win32shutdown (8)Next
2. The delay is 60 seconds. If you are prompted before shutdown, you can cancel shutdown before the delay is reached (shutdown2.vbs script ):Set wshshell = Createobject ("wscript. Shel
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.