jvilla1983
Programmer
Hi, my name is Joseph. I'm looking for some help with editing a login script that was created with VBscript.
What I'm trying to accomplish is to search through a certain folder and find files older than 90 days. I keep thinking that I'm should do this with an array or a loop, but I know that scripting is a different animal than other high level languages.
This is what I have so far..
sub deleteReallyOldFiles()
' Connecting the "I" drive
objNet.MapNetworkDrive "I:", "\\xxxxxxxxx0002\ITS"
date_mod=Date-90
Set FSO = CreateObject("Scripting.FileSystemObject")
For Each SubFiles in FSO.GetFolder("I:\AutomatedManualBackup\user.id\").Files
IF SubFiles.DateLastModified <= date_mod Then
Wscript.Echo SUbFiles.Name
SubFiles.Delete
End IF
' Disconnecting the "I" drive
objNet.RemoveNetworkDrive "I:", true, true
End Sub
I'm getting an error on the End Sub and I have no idea why.
Thanks in advance for any help..
Joseph Villa
What I'm trying to accomplish is to search through a certain folder and find files older than 90 days. I keep thinking that I'm should do this with an array or a loop, but I know that scripting is a different animal than other high level languages.
This is what I have so far..
sub deleteReallyOldFiles()
' Connecting the "I" drive
objNet.MapNetworkDrive "I:", "\\xxxxxxxxx0002\ITS"
date_mod=Date-90
Set FSO = CreateObject("Scripting.FileSystemObject")
For Each SubFiles in FSO.GetFolder("I:\AutomatedManualBackup\user.id\").Files
IF SubFiles.DateLastModified <= date_mod Then
Wscript.Echo SUbFiles.Name
SubFiles.Delete
End IF
' Disconnecting the "I" drive
objNet.RemoveNetworkDrive "I:", true, true
End Sub
I'm getting an error on the End Sub and I have no idea why.
Thanks in advance for any help..
Joseph Villa