-
Notifications
You must be signed in to change notification settings - Fork 225
/
VBScript.vbs
342 lines (310 loc) · 7.16 KB
/
VBScript.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
' VBScript Language Reference
' https://learn.microsoft.com/en-us/previous-versions/d1wf56tt(v=vs.85)
' VBScript
' https://learn.microsoft.com/en-us/previous-versions/t0aew7h6(v=vs.85)
' https://documentation.help/MS-Office-VBScript/VBSTOC.htm
'! keywords =======================================================
' Statements https://learn.microsoft.com/en-us/previous-versions/7aw9cadb(v=vs.85)
Call
Class
Public Property Get
Set
Exit Property
End Property
Default Property Let
End Property
Private Property Set
End Property
End Class
Const
Dim
Do
Do While
Loop
Do Until
Loop
Do
Loop While
Do
Loop Until
Exit Do
Loop
Erase
Execute
ExecuteGlobal
For Each In
Exit For
Next
For To Step
Next
Default Function ByVal ByRef
Exit Function
End Function
If
ElseIf Then
Else
End If
If Then Else
On Error Resume Next
On Error GoTo
Option Explicit
Randomize
ReDim Preserve
Rem
Select Case
Case Else
End Select
Set New Nothing
Stop
Sub ByVal ByRef
Exit Sub
End Sub
While
Wend
With
End With
' Operators https://learn.microsoft.com/en-us/previous-versions/1cbft50a(v=vs.85)
Not And Or Xor Eqv Imp Is Mod
' Keywords https://learn.microsoft.com/en-us/previous-versions/f8tbc79x(v=vs.85)
Empty False Nothing Null True
' reserved types
Boolean Byte Currency Date Double Integer Long Single String Variant
' other types
Char Decimal LongLong LongPtr Object
' reserved words https://flylib.com/books/en/2.442.1/vbscript_basics.html
' https://isvbscriptdead.com/reserved-keywords/
As
EndIf Enum Event
Implements
Like LSet
Me
Optional
ParamArray
RaiseEvent RSet
Shared Static
Type TypeOf
' other words
Alias Attribute Begin
Compare Continue
Declare
Friend
Global GoSub
Lib Load
Module
Return
Unload
WithEvents
'! objects =======================================================
' https://learn.microsoft.com/en-us/previous-versions/22h7a6k8(v=vs.85)
Debug {
Write([str1 [, str2 [, ... [, strN]]]])
WriteLine([str1 [, str2 [, ... [, strN]]]])
}
Err {
Description
HelpContext
HelpFile
Number
Source
Clear()
Raise(number, source, description, helpfile, helpcontext)
}
RegExp {
Global
IgnoreCase
Pattern
Execute(string)
Replace(string1, string2)
Test(string)
' Match Object
FirstIndex
Length
Value
}
Dictionary {
Count
Item(key)
Key(key)
CompareMode
Add(key, item)
Exists(key)
Items()
Keys()
Remove(key)
RemoveAll()
}
FileSystemObject {
Drives
BuildPath(path, name)
CopyFile(source, destination[, overwrite])
CopyFolder(source, destination[, overwrite]);
CreateFolder(foldername)
CreateTextFile(filename[, overwrite[, unicode]])
DeleteFile(filespec[, force]);
DeleteFolder(folderspec[, force]);
DriveExists(drivespec)
FileExists(filespec)
FolderExists(folderspec)
GetAbsolutePathName(pathspec)
GetBaseName(path)
GetDrive(drivespec)
GetDriveName(path)
GetExtensionName(path)
GetFile(filespec)
GetFileVersion(pathspec)
GetFileName(pathspec)
GetFolder(folderspec)
GetParentFolderName(path)
GetSpecialFolder(folderspec)
GetStandardStream(standardStreamType [, unicode])
GetTempName()
MoveFile(source, destination);
MoveFolder(source, destination);
OpenTextFile(filename[, iomode[, create[, format]]])
}
{ ' TextStream
AtEndOfLine
AtEndOfStream
Column
Line
Close()
Read(characters)
ReadAll()
ReadLine()
Skip(characters)
SkipLine()
Write(string)
WriteBlankLines(lines)
WriteLine([string])
OpenAsTextStream([iomode, [format]])
}
' Windows Script Host
' https://learn.microsoft.com/en-us/previous-versions/ms950396(v=msdn.10)
ActiveXObject {
}
WScript {
}
'! functions =======================================================
' https://learn.microsoft.com/en-us/previous-versions/3ca8tfek(v=vs.85)
Abs(number)
Array(arglist)
Asc(string)
Atn(number)
CBool(expression)
CByte(expression)
CCur(expression)
CDate(date)
CDbl(expression)
Chr(charcode)
CInt(expression)
CLng(expression)
CSng(expression)
CStr(expression)
Hex(number)
Oct(number)
Cos(number)
CreateObject(servername.typename [, location])
Date
DateAdd(interval, number, date)
DateDiff(interval, date1, date2 [,firstdayofweek[, firstweekofyear]])
DatePart(interval, date[, firstdayofweek[, firstweekofyear]])
DateSerial(year, month, day)
DateValue(date)
Day(date)
Escape(charString)
Eval(expression)
Exp(number)
Filter(InputStrings, Value[, Include[, Compare]])
FormatCurrency(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits]]]])
FormatDateTime(Date[, NamedFormat])
FormatNumber(Expression [,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits]]]])
FormatPercent(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits]]]])
GetLocale()
GetObject([pathname] [, class])
GetRef(procname)
Hour(time)
InputBox(prompt[, title][, default][, xpos][, ypos][, helpfile, context])
InStr([start, ]string1, string2[, compare])
InStrRev(string1, string2[, start[, compare]])
Int(number)
Fix(number)
IsArray(varname)
IsDate(expression)
IsEmpty(expression)
IsNull(expression)
IsNumeric(expression)
IsObject(expression)
Join(list[, delimiter])
LBound(arrayname[, dimension])
LCase(string)
Left(string, length)
Len(string | varname)
LoadPicture(picturename)
Log(number)
LTrim(string)
RTrim(string)
Trim(string)
Mid(string, start[, length])
Minute(time)
Month(date)
MonthName(month[, abbreviate])
MsgBox(prompt[, buttons][, title][, helpfile, context])
Now
Replace(expression, find, replacewith[, start[, count[, compare]]])
RGB(red, green, blue)
Right(string, length)
Rnd[(number)]
Round(expression[, numdecimalplaces])
ScriptEngine
ScriptEngineBuildVersion
ScriptEngineMajorVersion
ScriptEngineMinorVersion
Second(time)
SetLocale(lcid)
Sgn(number)
Sin(number)
Space(number)
Split(expression[, delimiter[, count[, compare]]])
Sqr(number)
StrComp(string1, string2[, compare])
String(number, character)
StrReverse(string1)
Tan(number)
Time
Timer
TimeSerial(hour, minute, second)
TimeValue(time)
TypeName(varname)
UBound(arrayname[, dimension])
UCase(string)
Unescape(charString)
VarType(varname)
Weekday(date, [firstdayofweek])
WeekdayName(weekday, abbreviate, firstdayofweek)
Year(date)
'! constants =======================================================
' https://learn.microsoft.com/en-us/previous-versions/ydz4cfk3(v=vs.85)
' Color Constants
vbBlack vbRed vbGreen vbYellow vbBlue vbMagenta vbCyan vbWhite
' Comparison Constants
vbBinaryCompare vbTextCompare
' Date and Time Constants
vbSunday vbMonday vbTuesday vbWednesday vbThursday vbFriday vbSaturday
vbUseSystemDayOfWeek vbFirstJan1 vbFirstFourDays vbFirstFullWeek
' Date Format Constants
vbGeneralDate vbLongDate vbShortDate vbLongTime vbShortTime
' Miscellaneous Constants
vbObjectError
' MsgBox Constants
vbOKOnly vbOKCancel vbAbortRetryIgnore vbYesNoCancel vbYesNo vbRetryCancel
vbCritical vbQuestion vbExclamation vbInformation
vbDefaultButton1 vbDefaultButton2 vbDefaultButton3 vbDefaultButton4
vbApplicationModal vbSystemModal
vbOK vbCancel vbAbort vbRetry vbIgnore vbYes vbNo
' String Constants
vbCr vbCrLf vbFormFeed vbLf vbNewLine vbNullChar vbNullString vbTab vbVerticalTab
' Tristate Constants
vbUseDefault vbTrue vbFalse
' VarType Constants
vbEmpty vbNull vbInteger vbLong vbSingle vbDouble vbCurrency vbDate vbString
vbObject vbError vbBoolean vbVariant vbDataObject vbDecimal vbByte vbArray