' ======================================
' SendKeys simulates keyboard keystrokes in VBS
' 2009-07-26
' Liu Lin
' ======================================
Dim WshShell
Set WshShell=("")
"cmd"
' Let the script wait for 1000 milliseconds, that is, 1 second before executing the next statement
1000
' -- When sending characters, the input method must be in the English file state
' Send a semicolon
";"
1000
' Send a colon
":"
1000
' Send double quotes -- Use chr to convert double quotes out
Chr(34)
1000
' Send a string with double quotes
Chr(34)&"this is a string"&Chr(34)
1000
' -- Remember, this is a simulated keystroke operation, so you cannot send Chinese
' Chr(34)&"This is a string"&Chr(34)
1000
' ================================================
' -- How to simulate the Enter, Up key, Alt key?
' ================================================
' -- How to simulate carriage return, -- {enter} This means sending carriage return
"this is a enter!{enter}"
1000
' -- How to simulate the up-load key Shift, -- + This means sending shift
"this is +a" ' The result is this is A
1000
' -- How to simulate Alt, -- % This means sending Alt
"this is %{TAB}" ' The result is toggle window
1000
' ===========================================================
' -- Then how to send %, + ^
"this is {+}{^}{%}" ' The result is toggle window
1000
' -- You may already understand here. Please put it in {} when sending special characters.
' ===========================================================
' ======================================
'For more information, please refer to the VBS Help Document 2009-07-26
' ======================================