Hi there
I'm a newbie to programming but very much willing to work hard and try. We have about 100 servers and on each servers we have the g drive and e drive. early this year there were some temp files dumped all over the 100 servers under variuos folders and subfolders so i have been assigned a task to clean this up. Any chance someone can guide me in getting an automated script where all i need to do is enter the list of servers and the file extension to search and then script would scan for the file extension on all 100 servers and each of the drives associated with it.
so far i have the following script
Rem Script created: 01.10.2009 22:24
Rem Author: captedgar
strDir = "c:\"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objDir = FSO.GetFolder(strDir)
getInfo(objDir)
Sub getInfo(pCurrentDir)
For Each aItem In pCurrentDir.Files
If LCase(Right(CStr(aItem.Name), 3)) = "tmp" Then
'wscript.Echo aItem.Name 'all c:\*.tmp
listed
End If
Next
For Each aItem In pCurrentDir.SubFolders
getInfo(aItem) 'passing recursively
Next
End Sub
regards
I'm a newbie to programming but very much willing to work hard and try. We have about 100 servers and on each servers we have the g drive and e drive. early this year there were some temp files dumped all over the 100 servers under variuos folders and subfolders so i have been assigned a task to clean this up. Any chance someone can guide me in getting an automated script where all i need to do is enter the list of servers and the file extension to search and then script would scan for the file extension on all 100 servers and each of the drives associated with it.
so far i have the following script
Rem Script created: 01.10.2009 22:24
Rem Author: captedgar
strDir = "c:\"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objDir = FSO.GetFolder(strDir)
getInfo(objDir)
Sub getInfo(pCurrentDir)
For Each aItem In pCurrentDir.Files
If LCase(Right(CStr(aItem.Name), 3)) = "tmp" Then
'wscript.Echo aItem.Name 'all c:\*.tmp
listed
End If
Next
For Each aItem In pCurrentDir.SubFolders
getInfo(aItem) 'passing recursively
Next
End Sub
regards