/build/static/layout/Breadcrumb_cap_w.png

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.

0 Comments   [ + ] Show comments

Answers (3)

Posted by: anonymous_9363 14 years ago
Red Belt
0
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.
Posted by: jessiewestlake 14 years ago
Yellow Belt
0
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...
Posted by: anonymous_9363 14 years ago
Red Belt
0
Build an array (or dictionary - arrays are so 70s) of the names and then loop through that array/dictionary, calling the relevant function and passing the filename to it.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ