Hi all,
I'm creating a DTS Package that only has a one step, which is an activeX script. It is supposed to remove any files with a .BKP extension. The script is as follows:
call CleanFile("\\Server\F$\SQL_Backup\")
sub CleanFile(folderspec)
Dim fso
Dim oFolder
Dim oFile
Dim f1
set fso = CreateObject("Scripting.FileSystemObject")
set oFolder = fso.GetFolder(folderspec)
set oFile = oFolder.Files
For each f1 in oFile
IF Right(f1.Name,3) = "BKP" then
fso.DeleteFile(folderspec + f1.Name)
END IF
next
set oFolder = Nothing
set fso = Nothing
End sub
When I run the activeX script it shows failure and it returns an error: "Function NOT Found" but it still deleted the files with .BKP extension.
Does anybody know what I'm doing wrong here?
Any help is greatly appreciated.
I'm creating a DTS Package that only has a one step, which is an activeX script. It is supposed to remove any files with a .BKP extension. The script is as follows:
call CleanFile("\\Server\F$\SQL_Backup\")
sub CleanFile(folderspec)
Dim fso
Dim oFolder
Dim oFile
Dim f1
set fso = CreateObject("Scripting.FileSystemObject")
set oFolder = fso.GetFolder(folderspec)
set oFile = oFolder.Files
For each f1 in oFile
IF Right(f1.Name,3) = "BKP" then
fso.DeleteFile(folderspec + f1.Name)
END IF
next
set oFolder = Nothing
set fso = Nothing
End sub
When I run the activeX script it shows failure and it returns an error: "Function NOT Found" but it still deleted the files with .BKP extension.
Does anybody know what I'm doing wrong here?
Any help is greatly appreciated.