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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 09/16/2009 by: VBScab
Red Belt

Please log in to comment
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...
Answered 09/16/2009 by: jessiewestlake
Yellow Belt

Please log in to comment
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.
Answered 09/16/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity