Skip to Content
Windows Me Annoyances
book

Windows Me Annoyances

by David A. Karp
March 2001
Intermediate to advanced
480 pages
14h 8m
English
O'Reilly Media, Inc.
Content preview from Windows Me Annoyances

Wacky Script Ideas

The point of scripting is that instead of using a canned application to perform a certain task, you can easily and quickly throw together a script that does exactly what you need. That said, you may need some inspiration to get you cooking.

The following examples use many of the custom subroutines outlined earlier in this book, but for brevity and sanity, they won’t be repeated.

Quick Floppy Backup Tool

The script in Example 9-4 starts by prompting you for the name of a folder to back up and checks to see if it exists. If not, it gives you an opportunity either to type another folder name or exit. Once a valid folder name has been entered, the script creates a backup of the entire folder on your floppy drive.

Example 9-4. Quick Floppy Backup Tool

On Error Resume Next Accepted = False Do Until Accepted MyFolder = InputBox("Please enter the name of the folder _ you want to back up.") If Not FolderExists(MyFolder) Then Answer = MsgBox("The folder you typed doesn't exist. _ Try again?", 36, "") If Answer = 7 Then WScript.Quit Else Accepted = True End If Loop Answer = MsgBox("Please put a diskette in your floppy drive.", 33, "") If FolderSize(MyFolder) > DriveFreeSpace("a") Then MsgBox "The folder you specified won't fit on the floppy.", 16 WScript.Quit End If If FolderCreate("a:\Backup\") = False Then MsgBox "There was a problem writing to the diskette.", 16 WScript.Quit End If Call FolderCopy(MyFolder, "a:\Backup\") If Right(MyFolder, 1) <> "\" Then MyFolder = MyFolder ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows XP Professional: The Missing Manual

Windows XP Professional: The Missing Manual

David Pogue, Craig Zacker, L.J. Zacker
Windows XP Pro: The Missing Manual, Second Edition

Windows XP Pro: The Missing Manual, Second Edition

David Pogue, Craig Zacker, L.J. Zacker
Windows XP in a Nutshell, Second Edition

Windows XP in a Nutshell, Second Edition

David A. Karp, Tim O'Reilly, Troy Mott

Publisher Resources

ISBN: 059600060XCatalog PageErrata