stevemarks59
Technical User
How can I combine these 10 vbs files into 1 vbs file and include "On Error Resume Next"?
To delete these folders:
C:\Profiles\STEVE\extensions
D:\Profiles\STEVE\extensions
I use the following 2 scripts:
CODE
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FolderExists(pathToFolder)) Then
Set objFolder = objFS.GetFolder(pathToFolder)
objFolder.Delete True
End if
CODE
pathToFolder = ("D:\Profiles\STEVE\extensions")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FolderExists(pathToFolder)) Then
Set objFolder = objFS.GetFolder(pathToFolder)
objFolder.Delete True
End if
To delete these files:
C:\Profiles\STEVE\extensions.rdf
C:\Profiles\STEVE\extensions.ini
C:\Profiles\STEVE\extensions.cache
C:\Profiles\STEVE\extensions.log
D:\Profiles\STEVE\extensions.rdf
D:\Profiles\STEVE\extensions.ini
D:\Profiles\STEVE\extensions.cache
D:\Profiles\STEVE\extensions.log
I use the following 8 scripts:
CODE
pathToFile = ("C:\Profiles\STEVE\extensions.rdf")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("C:\Profiles\STEVE\extensions.ini")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("C:\Profiles\STEVE\extensions.cache")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("C:\Profiles\STEVE\extensions.log")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("D:\Profiles\STEVE\extensions.rdf")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("D:\Profiles\STEVE\extensions.ini")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("D:\Profiles\STEVE\extensions.cache")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("D:\Profiles\STEVE\extensions.log")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
I would appreciate help on this.
Thank you.
To delete these folders:
C:\Profiles\STEVE\extensions
D:\Profiles\STEVE\extensions
I use the following 2 scripts:
CODE
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FolderExists(pathToFolder)) Then
Set objFolder = objFS.GetFolder(pathToFolder)
objFolder.Delete True
End if
CODE
pathToFolder = ("D:\Profiles\STEVE\extensions")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FolderExists(pathToFolder)) Then
Set objFolder = objFS.GetFolder(pathToFolder)
objFolder.Delete True
End if
To delete these files:
C:\Profiles\STEVE\extensions.rdf
C:\Profiles\STEVE\extensions.ini
C:\Profiles\STEVE\extensions.cache
C:\Profiles\STEVE\extensions.log
D:\Profiles\STEVE\extensions.rdf
D:\Profiles\STEVE\extensions.ini
D:\Profiles\STEVE\extensions.cache
D:\Profiles\STEVE\extensions.log
I use the following 8 scripts:
CODE
pathToFile = ("C:\Profiles\STEVE\extensions.rdf")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("C:\Profiles\STEVE\extensions.ini")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("C:\Profiles\STEVE\extensions.cache")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("C:\Profiles\STEVE\extensions.log")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("D:\Profiles\STEVE\extensions.rdf")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("D:\Profiles\STEVE\extensions.ini")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("D:\Profiles\STEVE\extensions.cache")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
CODE
pathToFile = ("D:\Profiles\STEVE\extensions.log")
Set objFS = CreateObject("Scripting.FileSystemObject")
If (objFS.FileExists(pathToFile)) Then
Set objFile = objFS.GetFile(pathToFile)
objFile.Delete True
End if
I would appreciate help on this.
Thank you.