The book you need to succeed! Vbscript, jscript



Yüklə 12,95 Mb.
Pdf görüntüsü
səhifə6/91
tarix07.11.2018
ölçüsü12,95 Mb.
#78682
1   2   3   4   5   6   7   8   9   ...   91

xvi
 
 Contents
Running Programs from Within Scripts ........................................................................... 121
Starting an application ............................................................................................ 121
Passing arguments to an application .......................................................................122
Additional features for Run .....................................................................................122
Running Scripts Remotely ................................................................................................ 124
Combining JScript and VBScript ......................................................................................126
Summary ..........................................................................................................................128
Input, Output, and Error Handling with VBScript and JScript
Chapter 7: 
 . . . 129
Input and Output Essentials .............................................................................................129
Using Input Boxes ............................................................................................................ 131
Input box basics ...................................................................................................... 131
Setting default values for input boxes .....................................................................132
Positioning input boxes ..........................................................................................132
Converting input values ..........................................................................................132
Using Message Boxes ........................................................................................................133
Message box basics .................................................................................................133
Adding buttons .......................................................................................................134
Adding icons ........................................................................................................... 135
Evaluating button clicks .........................................................................................136
Help fi les for message boxes ................................................................................... 137
Using pop-up dialog boxes ..................................................................................... 137
Error Detection and Handling .......................................................................................... 141
Handling runtime errors in VBScript ..................................................................... 141
Preventing runtime errors from halting script execution .............................. 141
Checking for and catching errors in VBScript ...............................................144
Manually generating runtime errors ............................................................. 146
Handling runtime errors in JScript ......................................................................... 147
Checking for and catching errors in JScript .................................................. 147
Throwing errors ............................................................................................ 148
Other error-handling techniques ..................................................................150
Summary ..........................................................................................................................152
Working with Files and Folders in VBScript and JScript
Chapter 8: 
 . . . . . . . 153
Understanding the FileSystemObject ...............................................................................153
FSO objects and collections ....................................................................................154
FSO methods and properties ..................................................................................154
Using the FileSystemObject ....................................................................................156
Working with Folders .......................................................................................................156
Checking folder contents ........................................................................................157
Examining folder properties ...................................................................................159
Creating folders ...................................................................................................... 163
Copying, moving, and deleting folders ...................................................................164
Issues for multiple folders .......................................................................................164
Using DeleteFolder ........................................................................................164
Using CopyFolder ......................................................................................... 165
Using MoveFolder ......................................................................................... 166
86804ftoc.indd   xvi
86804ftoc.indd   xvi
1/22/09   11:53:41 AM
1/22/09   11:53:41 AM


xvii
 
Contents  
Issues for individual folders .................................................................................... 167
Using Delete .................................................................................................. 167
Using Copy ................................................................................................... 167
Using Move ...................................................................................................168
Using Special Folders .......................................................................................................168
Working with Files ........................................................................................................... 170
Examining fi le properties ....................................................................................... 170
Creating fi les ........................................................................................................... 173
Copying, moving, and deleting fi les ....................................................................... 175
Issues for multiple fi les ........................................................................................... 175
Using DeleteFile ............................................................................................ 176
Using CopyFile ............................................................................................. 176
Using MoveFile ............................................................................................. 177
Issues for individual fi les ........................................................................................ 178
Using Delete .................................................................................................. 178
Using Copy ................................................................................................... 179
Using Move ...................................................................................................180
Summary ..........................................................................................................................180
Reading and Writing Files
Chapter 9: 
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Opening Files ................................................................................................................... 181
Using OpenTextFile ................................................................................................ 182
Using OpenAsTextStream ....................................................................................... 183
Reading Text Files ............................................................................................................184
Preparing to read ....................................................................................................184
Reading characters .................................................................................................. 187
Reading lines ..........................................................................................................188
Reading an entire fi le ..............................................................................................190
Skipping Lines in a File ....................................................................................................190
Skipping characters ................................................................................................ 191
Skipping lines ......................................................................................................... 191
Writing to a File ............................................................................................................... 192
Preparing to write ................................................................................................... 192
Writing characters ..................................................................................................194
Writing lines ...........................................................................................................194
Writing blank lines .................................................................................................194
Summary .......................................................................................................................... 195
Managing Drives and Printers with VBScript and JScript
Chapter 10: 
 . . . . . 197
Managing Drives .............................................................................................................. 197
Obtaining Drive Information............................................................................................ 197
Checking for a drive ...............................................................................................198
Using the Drive object ............................................................................................199
Examining all drives on a system ...........................................................................202
Mapping Network Drives .................................................................................................204
Connecting to a network share ...............................................................................204
Disconnecting from a network share ......................................................................205
86804ftoc.indd   xvii
86804ftoc.indd   xvii
1/22/09   11:53:41 AM
1/22/09   11:53:41 AM


Yüklə 12,95 Mb.

Dostları ilə paylaş:
1   2   3   4   5   6   7   8   9   ...   91




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə