Search For and Delete Multiple Files Across a Domain
Is there a way to search for multiple files on the C:\ excluding system folders (searching most importantly in the Documents and Settings of multiple users) for multiple files? Possibly a script that points to a seperate file with a list of filenames to find and delete, and get the results of any deleted files to output to a log with the Computer name and complete pathname of the deleted files. I'm trying to do this over a network running exclusively windows XP Pro.
Trying to search for and delete computer games off of users machines. Most of which will not be in Add/Remove Programs, such as Flash games. Thanks!!! I tried to manipulate the scripts in the Thread with the similar thread to mine, with very limited luck.
Trying to search for and delete computer games off of users machines. Most of which will not be in Add/Remove Programs, such as Flash games. Thanks!!! I tried to manipulate the scripts in the Thread with the similar thread to mine, with very limited luck.
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
anonymous_9363
15 years ago
Of course there's a way but your requirement represents quite a body of work which is unlikely to be available for free.
Your best recourse would be to find separate scripts to perform each function and then combine their functionality into one script. So start with a domain-walker, then a 'find file' example, then a logging one.
As an example of how a similar thing can be done, look up the MouseTrax domain reporting utility.
Your best recourse would be to find separate scripts to perform each function and then combine their functionality into one script. So start with a domain-walker, then a 'find file' example, then a logging one.
As an example of how a similar thing can be done, look up the MouseTrax domain reporting utility.
Posted by:
jessiewestlake
15 years ago
I understand. Well I found a script that will locate a file in the "Documents and Settings" directory, but could I replace the filename to search for with something that points to a whole list of filenames? So I can easily add/edit filenames?
The script I have is below.
[hr]
ShowFolderList("C:\Documents and Settings")
Function ShowFolderList(folderspec)
Dim fso, f, f1, s, sf
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set sf = f.SubFolders
For Each f1 in sf
ShowFolderList(f1.path)
ShowFileList(f1.path)
Next
End Function
Function ShowFileList(folderspec)
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
if strcomp(f1.name,"error.doc") = 0 then
fso.deletefile f1.path, true
Exit For
Exit Function
end if
Next
End Function
[hr]
Replacing the "error.doc" with a txt file containing a list of files such as:
error.doc
test.txt
program.exe
etc...
The script I have is below.
[hr]
ShowFolderList("C:\Documents and Settings")
Function ShowFolderList(folderspec)
Dim fso, f, f1, s, sf
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set sf = f.SubFolders
For Each f1 in sf
ShowFolderList(f1.path)
ShowFileList(f1.path)
Next
End Function
Function ShowFileList(folderspec)
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
if strcomp(f1.name,"error.doc") = 0 then
fso.deletefile f1.path, true
Exit For
Exit Function
end if
Next
End Function
[hr]
Replacing the "error.doc" with a txt file containing a list of files such as:
error.doc
test.txt
program.exe
etc...
Posted by:
anonymous_9363
15 years ago
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.