Sub Delete_Temp_Files_Primitive()
Dim sFileType As String ' Declare the Type of File
Dim sTempDir As String ' Temporary Directory
' ---------------------------------------------------------------
' Written By Shanmuga Sundara Raman for http://vbadud.blogspot.com
' ---------------------------------------------------------------
On Error Resume Next
sFileType = "*.tmp"
sTempDir = "c:\windows\Temp\" ' There might be mutiple temp directories (one for each profile) in Windows XP. Modify the code accordingly
Kill sTempDir & sFileType
' ---------------------------------------------------------------
' Delete Temporary Files, Excel VBA, Kill Statement
' ---------------------------------------------------------------
End Sub
Sunday, April 08, 2007
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.
Good procedure. Will it work in VBscript? I tried it and I'm not sure VBscript recognizes the wildcard in "*.tmp"
ReplyDeleteDir Function with wildcards in VBScript
ReplyDeleteCan you check the following link :http://www.source-code.biz/snippets/vbscript/1.htm