Tom's Guide | Tom's Hardware | Tom's Games | PC Safety Suite
![]() |
![]() |
![]() |
Comment:
I have some files I need to copy off a server but want to retain the creation date.
copy somefile.txt somefile%date:~10,4%%date:~7,2%%date:~4,2%.txt Will put todays date on the filename.
IS there a way to append the file date in the name on a copy or rename?
+1 | ![]() |
Maybe wording similar to this.
copy file off server with timestamp
http://www.google.com.au/search?hl=en&q=copy+file+off+server+with+timestamp&btnG=Search&meta=
+1 | ![]() |
Check out this thread. If your file system is FAT32 xcopy will work. If not, well .....
i_XpUser
+1 | ![]() |
Try this:
::== keepdat7.bat
:: stamp file with date before copy to keep orig date
:: file date layout is 04-05-06 05:52@echo off
for /f "tokens=*" %%F in ('dir /b/a-d') do call :sub1 %%F
goto :eof:sub1
set stamp=%~t1
set stamp=%stamp:~0,11%%stamp:~12,2%
echo copy %1 %~n1 %stamp%%~x1%
goto :eof
:: DONEYou may want to tinker with it and get the spaces out of the filenames. I certainly would. I don't need no steenking spaces.
If at first you don't succeed, you're about average.M2
+1 | ![]() |
I guess I should have clarified. I am wanting to append the file date to the file name on copy or rename or move..
I found this in the batch parameters help.
%~t1 Expands %1 to date and time of file.
I just don't know how to use it with the xcopy command.
Thanks
![]() |
Win XP only boots in Safe...
|
hard drive not recognized
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.