If you have Python installed (
www.python.org), the following script should
do what you want. All you have to do is insert the correct paths. This is
guaranteed to screw your system up royally, so make a backup and test it
on
a non-production system ;-).
Louis
Disclaimer: I am not a programmer but this worked on my machine.
-----begin script-----
import os
srcpath = r'path\to\search\directory' ##Insert path between quotes
dstpath = r'path\to\destination\directory' ##Insert path between quotes
srcfile1 = 'autoban' ##This is case sensitive
srcfile2 = 'comments.txt' ##This is case sensitive
for paths in os.walk(srcpath):
for files in paths:
if srcfile1 in files or srcfile2 in files:
mycommand = 'move ' + paths[0] + ' ' + dstpath
os.popen(mycommand)
-----end script-----
Rich said:
I run a game server and I need to be able to scan all folders in the client
directory for a file called 'autoban' and a file called comments.txt. Any
folder that contains either or both of these files needs to be moved to a
different location.
We're talking over 300+ folders. I'd like it to be automated but have no
idea how to program a batch file to do so. I think I need more than what you
gave me.
I do appreciate the response. Is there anything else you can give me?
"David Candy" <.> wrote in message
for /r %A in (.) do @If exist "%A\02a.jpg" echo %A
This will find a file called 02a.jpg and display the folder.
--
-------------------------------------------------------------------------- ------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================