Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Dos Copy w/ Date in Filename ??
Name: Michael McKenzie Date: October 24, 2002 at 08:25:26 Pacific OS: XP CPU/Ram: 512 MB Ram
Comment:
I am looking for a simple dos/bat programming script that will copy all (*.*) the files and back them up to another directory WHILE adding the DATE in the file name.
So if c:\jobs has files "outstanding.txt" and "reports.txt" how would I copy those over to c:\backup with new file names "outstanding_10-24-2002.txt" and "reprots_10-24-2002.txt" ??
Name: Michael McKenzie Date: October 24, 2002 at 12:00:23 Pacific
Reply:
The link is definitely a good resource, but doesn't answer my question. I am trying to copy files from one location to another AND renaming the file to include the DATE... so it would be filenameDATE.doc but in grabbind a %date% value in DOS it uses the "/" which is not a proper filename character... Is there anyway to put the date in another format? or write it to a file and then remove the /'s and THEN make it a filename ?
Any help would be greatly appreciated.
- Michael
0
Response Number 3
Name: Burbble Date: October 24, 2002 at 14:38:16 Pacific
Summary: Dear all does someone explain me why the code ::- echo off setLocal EnableDelayedExpansion for /f "tokens=* delims= " %%a in ('dir /b/a-d *.txt') do ( copy %%a %%~Na_%date:~-4,4%%date:~-7,2%%date:~-1...
Summary: OK, DOS geezers, am about to upgrade/migrate a RAID V array. Would like to retain (or recreate) original folder/directory creation dates in copying thousands of nested folders. Any hope in xxcopy or r...
Summary: Hi I would like to create a batch script which should pickup files from a share and then distribute them to different folders based on the filename. Filename is like str1_str2_str3.dat The files shoul...