Fires of Heaven Guild Message Board  

Go Back   Fires of Heaven Guild Message Board > General forums > Development
User Name
Password
ForumSpy Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 04-17-2008, 03:02 PM   #1 (permalink)
Criminiminal
Registered User
 
Criminiminal's Avatar
 
Join Date: Mar 2005
Posts: 672
-10 Internets
Need a search and destroy program

Anyone know of a program that can search every XP machine in a windows 2003 domain for a specific type of file and then archive them to another machine on the domain? or even just delete them from the host?

I started writing a vbs to do it via wmi, but it got to be too complex. Basically I need it to scan AD for all host names, make a list of them, go through each host's c drive (via \\hostname\c$\), search for the certain types of files, make a list or array of them, delete all the files in list or array, or move all files listed in array to another host (\\server\archive\%hostname%) and then move on to the next host.
__________________
I always say, you never know what a man is truly made of until you peel the skin off his face one piece at a time.
Criminiminal is offline   Reply With Quote
Old 04-28-2008, 06:38 PM   #2 (permalink)
AladainAF
Registered User
 
AladainAF's Avatar
 
Join Date: Aug 2002
Location: Texas
Posts: 1,716
Would this work as a batch file? (replace filename.txt with the file you want to delete and add lines as necessary). Test it first, i dunno if this would work, but it should I would think. I think that NET VIEW will show all computers on the network.

Code:
@echo off net view > systemsonnetwork.txt :{BEGIN}add more lines like below for each file or filespec you want to delete if it wont fit on 1 line for /f " tokens=1 " %%s in (systemsonnetwork.txt) do dir "%%s\c$\filename.txt *.tmp ~*.*" /s/a/b >> filestodelete.txt :{END}add more lines like below for each file or filespec you want to delete if it wont fit on 1 line for /f " tokens=1 " %%t in (filestodelete.txt) do del "%%t" >> deletelog.txt
edit: missed a quote

Last edited by AladainAF : 04-28-2008 at 06:49 PM.
AladainAF is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
uberguilds network



All times are GMT -7. The time now is 10:38 AM.


Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 RC6