Hi All, I want to create a batch file to move (not copy) a file Agg.DAT from the following source location to the following destination location. I want to rename the file with a timestamp (just after the file name) when it move to the destination folder.
Source Location:
D:\KR\Zee\Test_Batch\Import\Destination Location:
D:\KR\Zee\Test_Batch\Move\How can I create such a batch file.
Thanks a lot for your help.
Zee
Can someone help please? Thanks,
Zee
@echo off
for /f "skip=6 tokens=1-5*" %%a in ('dir D:\KR\Zee\Test_Batch\Import\agg.dat') do move "%%e" D:\KR\Zee\Test_Batch\Move\"%%e_%%a_%%b%%c"::or alternatively:
for %%a in (D:\KR\Zee\Test_Batch\Import\agg.dat) do move %%a D:\KR\Zee\Test_Batch\Move\"%%a_%%~ta"
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |