• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part III: Appendixes > Index of Sample Scripts and Batch Files

Index of Sample Scripts and Batch Files

Chapter Filename Description Page
1 script0101.vbs Totals up the space used in a given directory. 16
 script0102.vbs Totals up the spaces in an arbitrary directory. 26
2 script0201.vbs Prints a message appropriate to the time of day. 51
 script0202.vbs Prints a message appropriate to the time of day. 53
 script0203.vbs Prints a message appropriate to the day of the week. 54
 script0204.vbs Processes all matching files in a directory. 59
 script0205.vbs Processes files, making sure required files are present. 59
 script0206.vbs Sings a monotonous song. 60
 script0207.vbs Prints a list of files found in a folder. 61
 script0208.vbs Extracts the base name of a file. 66
 script0209.vbs Displays the current date and time. 67
 script0210.vbs Displays the current time in a pop-up box. 70
 script0211.vbs Prints debugging information. 72
 script0212.vbs Prompts the user for input. 73
 script0213.vbs Interactive calculator. 74
 script0214.vbs Prints a number with the correct English suffix. 76
 script0215.vbs Function; Calculates the name of a backup file. 78
 maybedel.vbs Function; Prompts the user before deleting a file. 78
4 script0401.vbs Creates a folder, including parent folders if needed. 122
 script0402.vbs Copies a folder for backup purposes. 127
 script0403.vbs Finds a drive with the most free space. 128
 script0404.vbs Deletes TMP and BAK files from a folder. 135
 script0405.vbs Deletes TMP and BAK files from a folder and any subfolders. 136
 script0406.vbs Performs an arbitrary task in a folder and all subfolders.137  
 script0407.vbs Modifies file attributes in a folder and all subfolders. 137
 script0408.vbs Reads input from a file and processes commands inside. 142
 script0409.vbs Lists all music files under My Documents. 144
 script0410.vbs Creates an index of all music files under My Documents. 146
 script0411.vbs Filters standard input, turning tabs to commas. 149
 script0412.vbs Demonstrates prompting for input. 150
 bmpsize.vbs Displays dimensions of BMP image files. 152
 script0413.vbs Displays artist/genre information for MP3 files. 154
 script0414.vbs Displays contents of an XML file. 165
 script0415.vbs Creates a simple HTML file. 167
 script0416.vbs Converts a text file into a slideshow XML file. 169
 script0417.vbs Creates a text file and runs Notepad to display it. 174
 script0418.vbs Performs a ping network test on a list of hosts. 177
 script0419.vbs Creates a desktop shortcut. 180
 script0420.vbs Displays all environment variables. 184
 script0421.vbs Adds a folder to the system default PATH. 185
 script0422.vbs Uses the Registry to count the number of times a script has run. 188
 script0423.vbs Installs and resets keys needed by script0420.vbs. 188
 script0424.vbs Stores a script's default parameter in the Registry. 188
5 script0501.vbs Sample logon script; Maps network drives. 197
 script0502.vbs Displays network drive mappings. 200
 script0503.vbs Displays network printer mappings. 202
 script0504.vbs Prints directly to a printer from a script. 213
6 script0601.vbs Sends an e-mail listing files in a folder. 244
 script0602.vbs Constructs an HTML text message body listing all files in a folder. 246
 script0603.vbs Sends a simple message. 252
 mailfiles.vbs Mails files named on the command line to a specific user. 253
 scanmail.vbs Automatically mails files found in a drop folder. 254
7 script0701.vbs Shows how to manage a list of computers. 273
 script0702.vbs Schedules a computer's drives to be checked upon reboot. 283
 script0703.vbs Terminates Windows applications by name. 284
 listprops.vbs Lists all properties and methods for a WMI object. 288
 script0704.vbs Lists network adapter information for a set of computers. 290
 script0705.vbs Lists hotfixes applied to a set of computers. 291
 script0706.vbs Lists the status of installed services on a set of computers. 294
8 script0801.vbs Lists all services, users, and groups on a computer. 309
 script0802.vbs Deletes a domain or local user account. 315
 script0803.vbs Lists all groups in a domain or computer using the object class. 316
 script0804.vbs Lists all groups in a domain or computer using filtering. 316
 script0805.vbs Lists all users in a domain or computer. 320
 script0806.vbs Lists all network users connected to a server. 322
 script0807.vbs Lists all shared files in use by network users. 322
 script0808.vbs Lists all shared files in use, ordered by username. 323
 script0809.vbs Lists all folders shared by a computer. 324
 script0810.vbs Shares a folder. 324
 script0811.vbs Creates a security group and adds users. 326
 script0812.vbs Lists users in a security group. 326
 script0813.vbs Lists all print jobs queued for a shared printer. 328
 script0814.vbs Lists all printers shared by a computer. 331
 script0815.vbs Lists the status of installed services on a computer. 336
 script0816.vbs Lists all network users connected to a server. 337
 script0817.vbs Lists Active Directory containers using LDAP. 343
 allpass.vbs Changes a user's password on all computers in a workgroup. 346
9 simple.wsc Simple object. 354
 script0901.vbs Tests the simple object. 357
 script0902.vbs Tests two instances of the simple object. 357
 scriptmail.wsc Scriptmail.Message object. Sends basic e-mail messages. 375
 script0903.vbs Demonstrates the Scriptmail.Message object. 378
10 deploy.vbs Deploys network printer updates to a large list of computers. 403
 cdburn.wsf Puts files onto CD-R using a hypothetical CD-burning utility. 395
 cleantemp.vbs Cleans temporary folders. 407
 script1001.vbs Runs the script cleantemp.vbs on remote computers. 408
 checkfree.vbs Determines the amount of free space on a disk. 409
 script1002.vbs Displays data returned by a remotely executed script. 409
 repl.vbs Replicates a set of files from a domain server to a workstation. 411
 signfile.vbs Signs script files. 414
 sched.vbs Demonstrates logging in scheduled scripts. 423
 script1003.vbs Demonstrates recording events in the system log. 425
 summary.vbs Summarizes the results of nightly scheduled scripts. 426
11 batch1101.bat Records a program's output in a log file and displays it on the console. 439
 batch1102.bat Shows how to prompt a user for input in a batch file. 441
12 batch1201.bat Processes an arbitrary list of files. 502
 batch1202.bat Processes an arbitrary list of files or a default file. 502
 sortmerge.bat Sorts multiple files into one output file. 504
 which.bat Shows what program file is used when you type a command line. 509
 batch1203.bat Shows how to use a subroutine when processing multiple files. 511
 batch1204.bat Shows how to process /x-type options in a batch file. 514
 batch1205.bat Shows how to create a log file that records a batch file's operation. 518
14 view.bat Filter; Collects standard input and displays it with Notepad. 548
 e.bat Opens explorer to view the current directory 549
 batch1401.bat Backs up My Documents to a network shared folder. 576
 mkaccount.bat Creates a student account for a class. 579



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint