Hi,
I have no batch file experience, but I need a batch file that will rename & copy/move files.. When the files have been copied, delete the original.
The new name would be the original name + a date/time stamp
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It’s mostly just building your date-time element:
@echo off & setlocal
set dtst=%date:~4%_%time:~0,8%
set dtst=%dtst:/=-%
set dtst=%dtst::=_
echo date-timestamp looks like: %dtst%
pause
:: edit: foll. line had unmatched, and misplaced quotes. this is fixed:
for %%a in (*.*) do move “%%a” “e:\wherever\%%~na_%dtst%%%~xa%”
::==== end batch
If you look examine lines 2,3 and 4, you will see what they do. First line 2 assembles substrings of date and time (date from the 4th character on, time from 1st thru 8th).
Then 3 replaces the / in the date with -, then 4 replaces the colons in the time with underscores. Understanding this, you can experiment around with whatever format you actually want. You should run the batch from the directory that has the files, preferably from the command prompt (running batch from icons almost always results in confusion and obfuscation.)