VB Script
VB Script
VB Script
com
Search…
1 de 3
VBScript Commands | SS64.com
h
Hex(number) Return the hex value of number
Hour(time) Return the hour component of time
i
If..Then Conditionally execute a block of statements
InputBox Prompt for user input
InStr Find one string within another
InStrRev Find one string within another, starting from the end
Int(number) Return the integer portion of a number
IsArray(varname) Is varname an array?
IsDate(expression) Is expression a DateTime?
IsEmpty(expression) Is expression initialised?
IsNull(expression) Is expression NULL?
IsNumeric(expression) Is expression a Numeric?
IsObject(expression) Is expression an object?
Join Combine the contents of an array into a single variable.
l
LBound Return the smallest subscript for an array.
LCase(String) Return String in lower case
Left(String,len) Return the leftmost len characters of string
LeftB(String,len) Return the leftmost len bytes of string
Len(String) Return length of string in characters
LenB(String) Return length of string in Bytes
Log(number) Return natural log of number
.LogEvent Log an item in the Event log
LTrim(String) Remove any leading spaces from a string expression
m
.MapNetworkDrive Drive Map
Mid Return a mid-section from a string
Minute(time) Return the minute component of time
Month(date) Return the month component of date
MonthName Convert a month number to a descriptive Month
MsgBox Display a dialogue box message
Now Return the current Date and Time
o
On Error Error handling
Option Explicit Force all variables to be defined
p
.AddPrinterConn / .AddWindowsPrConn Add Printer connection
.EnumPrinterConnections List Printer connections
.SetDefaultPrinter Set default printer
.RemovePrinterConnection Remove printer connection
Private VarName Declare a local variable/array variable
Public VarName Declare a public variable/array variable
q
.Quit Quit
r
Randomize(number) Initialise the random number generator
.ReadLine Accept user text input
ReDim Resize a dynamic array
RegExp Regular expression search object
.RegDelete Registry, delete
.RegRead Registry, read
.RegWrite Registry, write
REM Add a Comment
Replace Find and replace text
RGB(Red,Green,Blue) Return a system color code
Right(String,len) Return the rightmost len characters of string
RightB(String,len) Return the rightmost len bytes of string
Rnd Return a random number
Round Round a number to n decimal places
RTrim(String) Remove any trailing spaces from a string expression
.Run a command
s
Second(time) Return the second component of time
Select...Case Conditionally execute a block of statements
2 de 3
VBScript Commands | SS64.com
.SendKeys
Set variable = object Assign an object reference
SetLocale(LocaleID) Set the Regional LocaleID
Sgn(number) The sign of a number
.ShellExecute Run a script/application in the Windows Shell
Shortcut create .CreateShortcut
.Sleep
Space Return a string consisting of spaces.
.SpecialFolders Path to Desktop,Start menu, Programs...
Split Parse a string of delimited values into an array
Sqr(number) Square root
StrComp Compare two strings
String Create a string with a single character repeated
StrReverse Reverse a string
Sub Declare a sub procedure
t
Time() The current system time
Timer() The number of seconds since midnight
TimeSerial Construct a Time value from Hours, Minutes and seconds
TimeValue Convert a string to a Time value
Trim(String) Remove leading and trailing spaces from string
TypeName Return variable type (variant subtype).
u
UBound Return the largest subscript for an array dimension
UCase(String) Uppercase String
UnEscape(Str) Return Unicode characters from an escaped ASCII string
w
Weekday Return the day of the week (1-7)
WeekdayName Return the named day of the week
While...Wend Conditionally repeat a block of statements
With Assign multiple properties of an object
Year(date) Return the year component of date (1-12)
' Remark Add a Comment
• All VBScript variables are variants the conversion functions set the variant subtype (an internal flag
indicating the DataType) .
3 de 3