490
Folders Collection, 75
ForAppending, 239
For Each Next, 69, 127–129, 131, 175, 178–179
FormatCurrency(), 468
FormatDateTime(), 468
FormatNumber(), 80, 81, 468
FormatPercent(), 468
For Next, 69, 175–178
ForReading, 239, 241
ForWriting, 239, 241
FreeSpace, 76
FullName, 42
Function, 15, 69
Functions
creating custom, 205, 207–208
VBScript built-in, 81–83, 214, 467–471
G
GetAbsolutePathName, 78
GetBaseName, 78
GetDrive, 78
GetDriveName, 78
GetExtensionName, 78
GetFile(), 78, 236, 238
GetFileName, 78
GetFileVersion, 78
GetFolder, 78
GetLocale(), 468
GetParentFolderName, 78
GetPlayersName(), 208
GetObject(), 46, 468
HotKey, 42, 194
Hour(), 468
Hungarian Notation, 116
I
IconLocation, 42, 194
IDE (Integrated Development Environment), 23
If, 147, 148–151
nesting, 150–151
If Then Else, 69
IgnoreCase, 355
IIS (Internet Information Server), 20, 25
.ini, 253
INI (initialization files), 253–257
InitialDisplayString(), 302
Initialization section, 73
InputBox(), 30, 60, 84, 86–87, 130, 161, 468
Instantiation, 38
InStr(), 469
InStrRev(), 469
Int(), 60, 469
Integer, 111, 116
Interactive, 42
Interfaces, 10
Internet Explorer, 20, 24
intUserAge, 161
InvalidChoice(), 418–419
IsArray(), 469
IsDate(), 469
IsEmpty(), 469
IsNull(), 469
Length, 42, 355
Less than, 161, 162
Less than or equal to, 161, 162
Line, 42, 76
Lines
skipping, 246
writing, 243
LoadPicture(), 469
Log(), 469
LogEvent(), 46, 47, 49–50, 292–293
Log file, creating a custom, 291–292
Logical errors, 280, 285
Long, 111, 116
Loop, defined, 175
Looping statements
Do Until, 175, 183–184
Do While, 175, 180–182
For Each Next, 69, 127–129, 131, 175, 178–179
For Next, 69, 175–178
While Wend, 69, 175, 184–185
LTrim(), 469
Lucky Lottery Number Picker game, 233–235
designing, 257–275
M
ManageGamePlay(), 369, 372–375
MapNetworkDrive(), 46, 438–440
Mapping network drives, 438–440
disconnecting, 440–441
MarkPlayerSelection(), 369, 379–380
Match, 73, 354
Index
492
Names (naming) (continued)
constants, 106
duplicate names for files and folders, 252
Hungarian Notation, 116
variables, 115–116
Nesting if statements, 150–151
.NET, 22–23
NET GROUP, 446
NetInfo.vbs, 43
NET START, 445
NET STOP, 445
NET USER, 446–448
Network administration, 438–441
NonGuessedString(), 304–305
Notepad, 12, 477
Now(), 469
NowGoPlay(), 216, 221
Null, 111
Number, 42, 355
O
Object, 111, 116
Objects. See Core object model
Objects, VBScript
built-in, 73, 351–395
custom, 356–362
run-time, 74–75, 79–81
objFso, 236
Oct(), 470
ProcessID, 42
Processing section, 73
ProcessRandomNumber(), 258, 265–266
ProcessScriptIniFile(), 258, 261–263
Programs menu, 198–199
Properties, object
VBScript, 75–77, 355
WSH, 41–45
Property, 8
Property Get, 69
Property Let, 69
Property Set, 69
Pseudo code, 147
Public, 69
Python, 19, 399
Q
<?job ?> tag, 400–401
<?XML ?> tag, 400, 401–402
Quick Launch toolbar, 191, 192
adding script to, 199–200
Quit(), 38, 46, 297
R
Raise(), 290, 355, 362
Randomize, 60, 69
RandomNumber(), 213
Read, 78
Read(), 46, 247
ReadAll, 79
ReadAll(), 46, 247–248
Reading from files, 245–248
RemovePrinterConnection(), 47, 443–444
Replace(), 355, 363–364, 470
Replyl, 30, 31
Reply2, 31, 32
Reports, generating, 457–461
Reserved words/characters, 70, 71
ResetVariableDefaults(), 258, 266–267
Resizing arrays, 130–133
Resource kits, 9
<resource> </resource> tags, 400, 405
RetrieveWord(), 301, 335–336
Reusable code, 209
REXX (Restructured Extended Extractor language), 19, 399
RGB(), 470
Right(), 470
Rnd(), 60, 470
Rock, Paper, and Scissors game, 36
designing, 58–62
if statement, 152–158
RootFolder, 76
Root keys, 322–323
Round(), 470
RTrim(), 470
Run(), 47, 48–49, 94
RunScript(), 418
Run-time, VBScript
errors, 279–280, 283–285
methods, 77–79
objects, 74–75, 79–81
properties, 75–77
Sgn(), 470
ShareName, 76
Shortcuts
adding script to programs menu using, 198–199
adding script to Quick Launch toolbar using,
199–200
adding script to start menu using, 197–198
creating, 191–200
defined, 191
desktop, 193–195
example script, 200–201
properties, 192
ShortName, 76
493
Index
494
ShortPath, 77
ShowUsage(), 47
Sin(), 470
Single, 111, 116
Single-dimension arrays, 125–126
SitePad Pro, 479–480
Size, 77
Skip, 79
Skip(), 47, 246, 247
SkipLine, 79
SkipLine(), 47, 246
Skipping lines, 246
Sleep(), 38, 47, 95
Source, 42, 355
strIniFile, 256
strKeyName, 256
strName, 139, 357
strObject, 139
strStory, 139
strVacation, 139
Sub, 69, 205, 206–207
SubFolders, 77
SubMatches Collection, 73, 354
Subroutines, 69, 205, 206–207
Symbols
&, 44, 108
’, 70–71
*, 249
=, 117
//?, 53
//b, 53
//d, 53
//e:jscript, 53
//H:cscript, 52
//H:wscript, 52, 53
//i, 53
//job:id, 53
//logo, 53
//nologo, 52, 53
//s, 52, 53
//t:nn, 52, 53
//x, 53
for metacharacters, 364–366
?, 249
UserName, 43
V
ValidateAndRun(), 415–417
ValidateInput(), 369, 376–379
Value, 355
Values, registry
accessing, 326
creating, 326–329
defined, 324–325
deleting, 327
Variables, 30, 104
creating a local, 115
defined, 112–115
environment, 121–124
local versus global, 115, 117, 214–216
modifying values with expressions, 117–121
naming, 115–116
scope, 116–117
Variants
defined, 111, 116
list of subtypes, 111
VarType(), 471
vbCr, 109
vbCrLf, 44, 109, 110
vbFormFeed, 109
vbLf, 109
vbNewLine, 109
vbNullChar, 109
vbNullString, 109
vbOkOnly, 44, 106, 107
vbTab, 44, 109, 110
vbUseSystemDayOfWeek, 107
vbVerticalTab, 109
Version, 43
Visual Basic (VB), 22–26
Visual Basic for Applications (VBA), 22–26
VolumeName, 77
W
Web sites, Microsoft scripting, 26–28, 482–485
Weekday(), 471
WeekdayName(), 471
While Wend, 69, 175, 184–185
Wildcard characters, 249
Windows Script Console, 10, 11, 12, 20, 25
Windows Script Files
defined, 399
executing, 407
tags, 399–406
Windows shell, how it works, 9–12
Windows shell scripting, 8–9
WindowStyle, 43, 194
WinZip, 464–466
With, 69
WordPad, 94–96
WorkingDirectory, 43, 194
Write, 79
Write(), 47, 242–243
WriteBlankLines, 79
WriteBlankLines(), 47, 244
WriteLine, 79
WshShl, 16
WshShortcut, 39, 40, 194
WshSpecialFolders, 39, 41
WshUnnamed, 39, 40
WshUrlShortcut, 39, 41
X
XML (Extensible Markup Language),
supported tags, 399, 400–406
Y
Year(), 471
Index
Let’s face it.
C++, ASP, and Java can
be a little intimidating.
But now they don’t have
to be. The
for the
absolute
beginner series gives you
a fun, non-intimidating
introduction to the world
of programming. Each
book in this series teaches a
specific programming language using simple
game programming as a teaching aid. If you
are new to programming, want to learn, and
want to have fun, then Premier Press’s
for the
absolute beginner series is just what
you’ve been waiting for!
Microsoft
®
Visual Basic.NET
Programming for the Absolute Beginner
ISBN 1-59200-002-9
Palm
™
Programming
for the Absolute Beginner
ISBN 0-7615-3524-1
Python Programming
for the Absolute Beginner
ISBN 1-59200-073-8
Microsoft
®
Windows
®
Shell Script
Programming for the Absolute Beginner
ISBN 1-59200-085-1
Professional
■
Trade
■
Reference
Call 1.800.354.9706 to order
Order online at www.courseptr.com
This page intentionally left blank
Call 1.800.354.9706 to order
Order online at www.courseptr.com