Lab 15 Deleting Folders

In this lab, you are going to delete the folders created in Lab 14.

  1. Open Notepad.exe.

  2. Open your solution to Lab 14, or open Lab14Solution.vbs from the companion CD.

  3. Copy all the Header information section from Lab 14. The code will look like the following:

    Option Explicit
    Dim numFolders
    Dim folderPath
    Dim folderPrefix
    Dim objFSO
    Dim objFolder
    Dim i
  4. Copy the Reference section of the script from Lab 14. The code will look like the following:

    numFolders = 10
    folderPath = "C:\"
    folderPrefix = "Student"
  5. Implement a For...Next loop, using the variable i that goes to the variable numFolders. You can copy the following line from Lab 14 as well:

    For i = 1 To numFolders
  6. Create an instance of FileSystemObject. Use the CreateObject method, ...

Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.