1.

Solve : Batch file that copies text files according to date?

Answer»

Does any one know have a batch file that can search across a network for files that were created today and then copy them to another location across the network?I have had to do that, but try USING this program, Auto mate 6. Download a 30 day trial from here:

http://www.networkautomation.com/downloads/am6download.cfm

Tell me if it helps !
Will try DOWNLOADING the tool

This is the code that some one suggested, but i cant get it to work for my SETUP

@ECHO OFF

IF "%1" == "" GOTO COPY-TODAY
IF NOT "%1" == "" GOTO COPY-DATE


:COPY-TODAY
ECHO. | DATE | FIND /I "Current" > c:\BATCH\CUR-DATE.BAT
ECHO @SET CUR-DATE=%%4 > C:\BATCH\CURRENT.BAT
CALL C:\BATCH\CUR-DATE.BAT

XCOPY *.* C:\BATCH /D:%CUR-DATE% <


GOTO END

:COPY-DATE
XCOPY *.* C:\UPLOAD /D:%1 /-Y

:END
ECHO.
CALL C:\BATCH\DR.BAT C:\UPLOAD



SET CUR-DATE=


DEL c:\batch\CUR-DATE.BAT
DEL c:\batch\CURRENT.BAT




have been trying to get it to work in with this next bit of code

@echo off
echo copying files from 192.168.0.141
pause
xcopy /d \\192.168.0.141\d$\Hypercommain\*.txt \\192.168.0.108\d$\Hypercom\

@echo off
echo renaming file
pause
for /f "tokens=2 delims= " %%A in ('date/T') do (
set date=%%A)
for /f "tokens=1-3 delims=/" %%A in ('echo %date%') do (
set m=%%A
set d=%%B)
ren "\\192.168.0.108\d$\hypercom\*.txt" ZSW%m%%d%

@echo off
echo backing up to ZEDI Backup
pause
xcopy /e \\192.168.0.108\d$\Hypercom \\192.168.0.141\d$\testing


automate 6 didn't work i wanted it to
The whole point of this batch file is to avoid user error
Have designed this batch file so that the user simply clicks on it and it does all the work and thinking involved. Without me having to worry that the user has messed around with the wrong files or settings
Any help is greatly appreciatedWell im stumped. I have never really had to do something like that.Have decided to use a combo of the program you suggested and a bit of my batch file
Automate will find the files i need, copy them to the location i want them to be, and the my batch file will kick in and rename my files as i want them
Thanks for all the help



Discussion

No Comment Found