Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I've got the following batch file that is intended to rename all files in the "logfiles" directory...which works fine. Then I need it to move all those files into specific folders in the "urchin\pw01" directory...this is the part I'm having trouble with. I can get it to move the files into the directory, but I don't know how to put them in the specific folders.
In the "logfiles" directory the files are in folders named "W3SVC1, W3SVC2, W3SVC3, etc..." I want to move them over to the "urchin\pw01" directory into folders with the same names..."W3SVC1, W3SVC2, W3SVC3, etc..." To clarify, the files in logfiles\W3SVC1 need to be moved to urchin\pw01\W3SVC1 .
This needs to be automatic once the batch is started, no matter how many W3SVC... folders there might be.
Here's the code I have so far. Any ideas???
:: ----- rename -----
@for /R c:\test\prodweb01\logfiles\ %%f in (ex*.log) do rename "%%~ff" *.prodweb01.log
:: ----- move -----
@for /R c:\test\prodweb01\logfiles\ %%f in (ex*.log) do move "%%~ff" C:\test\urchin\pw01\

Have a look at:
LMOD
Versatile line/list modification tool to generate lists of commands, set variables to anything extracted from (DOS) output, and more.. Win NT/2000 compatible.
DEC 2002At URL: http://home.mnet-online.de/horst.muc/
This gem will enable you to take a
Dir *.* /b>dlist.txt
type of list, and pipe it through LMOD to produce a BATchfile which could create the Directory from the incoming filenames, and copy them into place.Baldy.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |