Our Newsletter


Subscribe to our Newsletter and we'll keep you notified of new products, giveaways and discounts.

We respect your email privacy and will never sell or share your details with anyone.


Knowledgebase Home | Glossary | Favorites | Contact | Login Knowledgebase Home | Glossary | Favorites | Contact | Login
Search the Knowledgebase Browse by Category
Working with VBScript Objects
Article Details

Last Updated
23rd of February, 2009

User Opinions (1 vote)
100% thumbs up 0% thumbs down

How would you rate this answer?
Helpful
Not helpful
When you need to use an object, it must first be instantiated. For example:

Set objFSO = CreateObject("Scripting.FileSystemObject")

This example uses the FileSystemObject to allow access to files, folders, drives and text files.

Dim objFSO, objFolder, objFile, objNewFolder
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\scripts\")
Set objNewFolder = objFSO.CreateFolder("C:\Test")
For Each objFile In objFolder.Files
objFile.Copy "C:\test\"
Next

The above script will create a folder called "Test" on the C: Drive and copy the contents of the C:\Scripts folder into the new test folder.





     
For more information about VBScript, check out our VBScript Training Videos
VBScript Training Videos
     



Visitor Comments
No visitor comments posted. Post a comment
Post Comment for "Working with VBScript Objects"
To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.
   Your Name:
   Email Address:
* Your Comment:
* Enter the code below:
 
Related Articles
No related articles were found.
Attachments
No attachments were found.