Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Which object is used to

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,595
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Which object is used to
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Which object is used to - 3/10/2002 6:32:31 PM   
  Arny

 

Posts: 2
Score: 0
Joined: 3/10/2002
From:
Status: offline
Which object is used to create/delete/modify files and directories?
What is the code used to instantiate that object?
 
 
Post #: 1
 
 Re: Which object is used to - 3/11/2002 12:02:17 PM   
  Tory

 

Posts: 16
Score: 0
Joined: 11/13/2001
From: USA
Status: offline
FileSystemObject (FSO) mostly. Check it out here:

http://www.devguru.com/Technologies/vbscript/quickref/objects.html

Here is an example that will invoke FSO, create a text file, write to it and then delete it....

Dim theTextFileName, fso, objFile
theTextFileName = "C:\textfile.txt" 'Sets up a variable as the file name
Set fso = CreateObject("Scripting.FileSystemObject") 'initalize the FSO object
Set objFile = fso.CreatetextFile(theTextFileName, TRUE) 'Makes the file
objFile.writeline("Your text goes here") 'Writes a line to the file
objFile.close 'closes the file
fso.DeleteFile theTextFileName, TRUE ' Deletes the file
Set fso = Nothing
Set objFile = Nothing


-Tory

(in reply to Arny)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Which object is used to Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts