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.
Batch copy and rename if needed
Name: JulianDavidson Date: September 27, 2006 at 16:06:13 Pacific OS: W2K CPU/Ram: Celeron 1.2GHz 512MB
Comment:
Hi Pretty new to batch files, and brand new to this forum... hoping someone can help me. I need a batch file that will move all files in one directory to another directory. If the filename already exists in the destination directory, all it needs to do is append the date and time that the file it's handling was created to the filename.
Name: tonysathre Date: September 30, 2006 at 17:34:02 Pacific
Reply:
You can't append the date and time the original file was created. You can however, append the current date and time using the %date% and %time% environment variables.
I don't have time to write you a script,but, the basics would be a FOR loop that using something like for %%i in (*) do goto mover. Then have a label named :mover that uses the if exist command to check the dirrectory to see if the filename exist. If it doesn't it moves the file, else, rename the file to filename%date%%time% then move.
I hope that Pseudo Code helps.
"Computer security." — Oxymoron
0
Response Number 2
Name: dtech10 Date: October 1, 2006 at 08:20:15 Pacific
Reply:
Hi Julian When renaming do you want to keep the extension ie File.txt to "File Date Time.txt" or "File.txt Date Time" I take it this is only done once. I'm english and using WinXp The command "echo %Date% on your system would be somthing like "Sun 10/01/2006" I assuming, is the correct.
0
Response Number 3
Name: JulianDavidson Date: October 1, 2006 at 19:21:28 Pacific
Reply:
Thanks for the replies. I got the need for this sorted another way.
Summary: Is 55K151AA a subdirectory of 55K139AA or is it a subdirectory of Orders. "Batch file Copy and Rename" is the subject of your post but the source and destination directory\subdirectories names don't c...
Summary: I'm looking for a batch file to copy a specified folder to another directory and rename it to the current date and time. (04.10.2007.11.27PM) or something like that. Reason for the date and time is be...
Summary: Hi all, I have been having problems writing a batch file to automate a process at work... Basically we have provided a folder for users to paste Lotus Notes archive .nsf files into which will be copie...