Vbscript Reference
Vbscript Reference
WshShell.Popup(Message, 5, Title, 1)
5: number of seconds to display popup box
1: displays the OK and Cancel buttons
HTA SECTION
<head>
<title>HTA Test</title>
<HTA:APPLICATION
APPLICATIONNAME="HTA Test"
SCROLL="yes" SINGLEINSTANCE="yes"
WINDOWSTATE="maximize" >
</head>
</head>
<script language="VBScript>
Sub window_OnLoad
' Script to run on startup
End Sub
Sub TestSub
' Script code goes here
End Sub
</script>
Option Explicit
If Err.Number Then
an error occurred
End If
Err.Clear
(execute this statement each
time you check the Err object)
strComputer = .
CONNECT TO WMI
strComputer = localhost
CREATE DICTONARY OBJECT
Const ForWriting = 2
Const ForReading = 1
SCRIPT SECTION
HTML SECTION
Set objDictionary = _
CreateObject("Scripting.Dictionary")
RETRIEVE AN OU
LOOPS
CONDITIONAL STATEMENTS
EXCEL
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add
If Then
Select Case
If x = 4 Then
ElseIf x = 5
Then
Else
...
End If
Select Case x
Case 1
...
Case 2
...
Case Else
End Select
For Loops
Do Loops
Do Until x > 5
...
Loop
For i = 1 to 10
...
Next
Do While x < 5
...
Loop
While Loops
Do
...
Loop Until x > 5
While x < 5
Wend
Do
...
Loop While x < 5
ARRAYS
arrItems =
Array("a","b","c")
Dim arr(2)
arr(0) = 20
arr(1) = 30
ReDim Preserve arr(3)
arr(2) = 40
Function
Subroutine
Function TestFunc
TestFunc = 10
End Function
Sub TestSub
End Sub
WORD
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Open("c:\scripts\test.doc")
ACCESS
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\Scripts\Test.mdb"
OUTLOOK
OUTLOOK