You are on page 1of 3

An A-Z Index of Windows VBScript commands

Abs(number) Absolute (positive) value of number .AppActivate Activate running command Array(el1,el2,el3) Add values to an Array variable Arguments Command line arguments Asc(String) Return ASCII code for string AscB(String) Return Byte code for string AscW(String) Return Unicode code for string .Bro se!or!older "rompt t#e user to select a folder c Call subroutine (arguments) or subroutine arguments CBool(expression) Convert expression to Boolean ($rue%!alse) & CByte(expression) Convert expression to Byte ('()**) & CCur(expression) Convert expression to Currency (numeric) & C+ate(expression) Convert expression to +ate & C+bl(expression) Convert expression to +ouble (up to ,.-./,'0'1) & C#r(ChrCode) Return t#e string c#aracter for ChrCode (ASCII code) C#rB(ChrCode) Return t#e string c#aracter for ChrCode (Byte code) C#rW(ChrCode) Return t#e string c#aracter for ChrCode (Unicode%+BCS) CInt(expression) Convert expression to Integer & C2ng(expression) Convert expression to long & CSng(expression) Convert expression to single & CStr(expression) Convert expression to a string & .Create3b4ect Create an automation ob4ect % run an e/ternal command .CreateS#ortcut Create S#ortcut cscript Run a 5BScript .vbs file .Current+irectory Retrieve or c#ange t#e current directory +ate() +ateAdd +ate+iff +ate"art +ateSerial +ate5alue +ay(date) +im +o..2oop +rives +rive 8ap $#e current system date Add a time interval to a +ate Return t#e time interval bet een t o dates Return a unit of time from a date Return a +ate from a numeric 6ear7 8ont# and +ay Return a +ate from a string e/pression Return t#e day component of date (,(0,) +eclare a ne variable or array variable Repeat a bloc9 of statements .8ap:et or9+rive ( .;num ( .Remove

.;c#o ;c#o te/t to screen7 also Std3ut.Write %."opup ;nd ;nd a procedure or code bloc9 ;nvironment 5ariables ( ;/pand ( .+elete%Remove ;scape(String) Return only ASCII c#aracters from a Unicode string. ;val(expr) ;valuate an e/pression .;/ec Run a command ;/p(n) Return e (base of natural logs) raised to a po er n. ;/it ;/it a bloc9 of code immediately !ileSystem3b4ect Wor9 it# +rives7 !olders and !iles !ilter "roduce an array by filtering an e/isting array !i/(number) Return t#e integer portion of a number

!or...:e/t !or ;ac#... !ormatCurrency !ormat:umber !ormat"ercent !ormat+ate$ime !unction g # i =et2ocale() .=et3b4ect >e/(number) >our(time) If..$#en InputBo/ InStr InStrRev Int(number)

(negative numbers round up) Repeat a bloc9 of statements a given number of times 2oop t#roug# t#e items in a collection or array !ormat a number it# a currency symbol !ormat a number !ormat a number it# a < symbol !ormat a +ate%$ime value +efine a function procedure Return t#e Regional 2ocaleI+ =et an Automation ob4ect Return t#e #e/ value of number Return t#e #our component of time

Conditionally e/ecute a bloc9 of statements "rompt for user input !ind one string it#in anot#er !ind one string it#in anot#er7 starting from t#e end Return t#e integer portion of a number (negative numbers round do n) IsArray(varname) Is varname an array? $rue%!alse Is+ate(expression) Is expression a +ate$ime? $rue%!alse Is;mpty(expression) Is expression empty? $rue%!alse Is:ull(expression) Is expression :U22? $rue%!alse Is:umeric(expression) Is expression a :umeric? $rue%!alse Is3b4ect(expression) Is expression an ob4ect? $rue%!alse 2Case(String) Return String in lo er case 2eft(String7len) Return t#e leftmost len c#aracters of string 2eftB(String7len) Return t#e leftmost len bytes of string 2en(String) Return lengt# of string in c#aracters 2enB(String) Return lengt# of string in Bytes 2og(number) Return natural log of number .2og;vent 2og an item in t#e ;vent log 2$rim(String) Remove any leading spaces from a string e/pression

.8ap:et or9+rive +rive 8ap 8id Return a mid(section from a string 8inute(time) Return t#e minute component of time 8ont#(date) Return t#e mont# component of date 8ont#:ame Convert a mont# number to a descriptive 8ont# 8sgBo/ +isplay a dialogue bo/ message :o () Return t#e current +ate and $ime 3n ;rror ;rror #andling 3ption ;/plicit !orce all variables to be defined .Add"rinterConn % .AddWindo s"rConn Add "rinter connection .;num"rinterConnections 2ist "rinter connections .Set+efault"rinter Set default printer .Remove"rinterConnection Remove printer connection "rivate VarName +eclare a local variable%array variable "ublic VarName +eclare a public variable%array variable

o p

@ r

.Auit

Auit

RandomiBe(number) Initialise t#e random number generator .Read2ine Accept user te/t input Re+im ResiBe a dynamic array Reg;/p Regular e/pression searc# ob4ect .Reg+elete Registry7 delete .RegRead Registry7 read .RegWrite Registry7 rite Replace !ind and replace te/t Rig#t(String7len) Return t#e rig#tmost len c#aracters of string Rig#tB(String7len) Return t#e rig#tmost len bytes of string R=B(Red7Green7Blue) Return a system color code Rnd Return a random number Round Round a number to n decimal places R$rim(String) Remove any trailing spaces from a string e/pression .Run a command Second(time) Return t#e second component of time Select...Case Conditionally e/ecute a bloc9 of statements .SendCeys Set variable D obje t Assign an ob4ect reference Set2ocale(!o ale"#) Set t#e Regional 2ocaleI+ Sgn(number) $#e sign of a number S#ortcut create .CreateS#ortcut .Sleep .Special!olders "at# to +es9top7Start menu7 "rograms... Split "arse a string of delimited values into an array S@r(number) S@uare root StrComp Compare t o strings String Create a string it# a single c#aracter repeated StrReverse Reverse a string Sub Start a subprocedure $ime() $imer() $imeSerial $ime5alue $rim(String) UBound UCase(String) Un;scape(Str) Wee9day Wee9day:ame W#ile...Wend Wit# 6ear(date) $#e current system time $#e number of seconds since midnig#t Construct a $ime value from >ours7 8inutes and seconds Convert a string to a $ime value Remove leading and trailing spaces from string Return t#e largest subscript for an array dimension Uppercase String Return Unicode c#aracters from an escaped ASCII string Return t#e day of t#e ee9 (,(-) Return t#e named day of t#e ee9 Conditionally repeat a bloc9 of statements Assign multiple properties of an ob4ect Return t#e year component of date (,(,))

You might also like