To enable system administrators to work more efficiently without worrying about mundane and repetitive tasks, Microsoft created Visual Basic Script, or VBScript. This simple language allows the administrator to write a program that performs tasks automatically with no more than a single mouse click. As an example, this tutorial will describe how to create a Visual Basic script that will empty your Downloads folder for you.
Instructions
-
Open a text editor. Any text editor will do, including the humble Windows Notepad. However, you may prefer an application like GVim that has built in-features for VBScript programming.
-
Paste the following script into the text editor:
Set FSO = CreateObject("Scripting.FileSystemObject");
path = "C:\Users\Kevin\Downloads"
for each file in FSO.GetFolder(path).Files
file.delete
Next
Change the "Kevin" to your own username. -
Save the file to your desktop with the name "Empty Downloads.vbs."
-
Double-click the file on your desktop any time you wish to empty your Downloads folder to save space. Use this with caution, however, since no confirmation is provided
- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
Comments
Post a Comment