1.

Solve : batch file to copy a file?

Answer»

I want to write a batch file to copy a file from one server to another. The FILENAME changes everyday and includes TODAY's date. How do I incorporate the changing filename into the script?Is the date the only THING that changes in the file NAME?yes, only the date changesSounds like Robocopy is the boy for you.You can try this.....


For /f "tokens=2-4 delims=/ " %%a in ('date/t') do (
Set month=%%a
Set day=%%b
Set year=%%c
)
REN D:\Temp\your_file.txt your_file%year%%month%%day%.TXT

should give you a file called your_file20090527.txt



Discussion

No Comment Found