Need vb script to delete runtime files
I need a vb script to delete the runtime files.
My application is delevering C:\Windows\cr3.tmp, C:\Windows\crpo.tmp, C:\Windows\crcon.tmp etc,.(cr*.tmp)
Common naming among these files is cr*.tmp
Could anyone reply me with the appropriate script to delete these files.
Thanx in Advance
Sanjeev
My application is delevering C:\Windows\cr3.tmp, C:\Windows\crpo.tmp, C:\Windows\crcon.tmp etc,.(cr*.tmp)
Common naming among these files is cr*.tmp
Could anyone reply me with the appropriate script to delete these files.
Thanx in Advance
Sanjeev
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
Inabus
15 years ago
Posted by:
sanhivi
15 years ago
I have created mst and installed the application. After launching the shortcut it is delevering some run time files
which I mentioned above. I have done some funcionality checking , after this also it is deleveing some run time files
but the files are having same naming convention like cr*.tmp. Here according to the functionality checking it is
delevering files.
which I mentioned above. I have done some funcionality checking , after this also it is deleveing some run time files
but the files are having same naming convention like cr*.tmp. Here according to the functionality checking it is
delevering files.
Posted by:
shweta_kar
15 years ago
strDir = "C:\WINDOWS"
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objDir = FSO.GetFolder(strDir)
getInfo(objDir)
Sub getInfo(pCurrentDir)
For Each aItem In pCurrentDir.Files
If (LCase(Left(Cstr(aItem.Name), 2)) = "cr") AND fso.GetExtensionName(LCase(aItem.Name)) = "tmp" Then
aItem.delete(True)
End If
Next
For Each aItem In pCurrentDir.SubFolders
'wscript.Echo aItem.Name & " passing recursively"
getInfo(aItem)
Next
End Sub
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objDir = FSO.GetFolder(strDir)
getInfo(objDir)
Sub getInfo(pCurrentDir)
For Each aItem In pCurrentDir.Files
If (LCase(Left(Cstr(aItem.Name), 2)) = "cr") AND fso.GetExtensionName(LCase(aItem.Name)) = "tmp" Then
aItem.delete(True)
End If
Next
For Each aItem In pCurrentDir.SubFolders
'wscript.Echo aItem.Name & " passing recursively"
getInfo(aItem)
Next
End Sub
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.