Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch File to add date and time stamp to the end of a file.

Status
Not open for further replies.

Neozero

MIS
Jul 7, 2000
49
US
I have a batch file that is not working when I run it. For some reason, I don't know where the error is in my script that would cause the file to not produce what I am wanting. I am trying to run a schedule task to add the date and time to a file and then copy that file to a different directory. It was working fine last week, but now I keep getting an error that says there is an error in myt batch file. Here is what I have.



cd ..\DataVault\exports

copy LetterData.txt HarlandClarkeArchive

copy HFSBill.txt HarlandClarkeArchive

cd Realm

ren LetterData.txt DailyLetterData_%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%,4%_%time:~0,2%%time:~3,2%_%time:~6,5%.txt

ren HFSBill.txt HFSBillStmt_%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%,4%_%time:~0,2%%time:~3,2%_%time:~6,5%.txt


Thanks in adavance for the help!


Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top