Trying to Delete a temp file 
Author Message
 Trying to Delete a temp file

Yes I'm new at this.  Yes I feel pretty stupid to have to ask this.  But...

In the following script, how do I delete the file when I'm done with it?

sL1 = "Line 1"
sL2 = "Line 2"
set oFS = CreateObject("Scripting.FileSystemObject")
set oTF = oFS.CreateTextFile("C:\~tmp.txt", 2)
oTF.Write sL1 & vbNewline & sL2
oTF.Close

'Do stuff w/ ~tmp.txt

oTF.Delete '<----- Object doesn't support this property... error

Thanks.



Wed, 10 Sep 2003 06:24:58 GMT  
 Trying to Delete a temp file
oTF.deletefile("c:\~tmp.txt")


Quote:
> Yes I'm new at this.  Yes I feel pretty stupid to have to ask this.
But...

> In the following script, how do I delete the file when I'm done with it?

> sL1 = "Line 1"
> sL2 = "Line 2"
> set oFS = CreateObject("Scripting.FileSystemObject")
> set oTF = oFS.CreateTextFile("C:\~tmp.txt", 2)
> oTF.Write sL1 & vbNewline & sL2
> oTF.Close

> 'Do stuff w/ ~tmp.txt

> oTF.Delete '<----- Object doesn't support this property... error

> Thanks.



Wed, 10 Sep 2003 07:10:12 GMT  
 Trying to Delete a temp file

Quote:
> sL1 = "Line 1"
> sL2 = "Line 2"
> set oFS = CreateObject("Scripting.FileSystemObject")
> set oTF = oFS.CreateTextFile("C:\~tmp.txt", 2)
> oTF.Write sL1 & vbNewline & sL2
> oTF.Close

> 'Do stuff w/ ~tmp.txt

> oTF.Delete '<----- Object doesn't support this property... error




Quote:
> oTF.deletefile("c:\~tmp.txt")

Actually

oFS.deletefile("c:\~tmp.txt")

Or

Set oTF = oFS.GetFile("C:\~tmp.txt")
oTF.Delete



Wed, 10 Sep 2003 08:45:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Deleting Temp internet files

2. Delete all temp internet files for all users

3. Delete temp.internet files ecc..(newbie)

4. How can I delete cookies and temp internet files w/VBS

5. Deleting Temp Internet files, new approach ?

6. Delete cookies and temp. inet files with VBS

7. Deleting Temp Internet Files via script

8. Delete temp file

9. Deleting Temp Internet Files via script

10. deleting temp internet files through script

11. strange error trying to delete file with .aspx page (security policy, trust level BS)

12. deleting temp images

 

 
Powered by phpBB® Forum Software