General discussion


xcopy question

By gcw804 ·
We are trying to copy a daily file and would like to enter a date into a bat file in order to only copy that one file. Any help is appreciated.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by willcomp In reply to xcopy question
Collapse -

by ReWrite In reply to xcopy question

You can use the /d:date option of xcopy to copy files with a certain date. If no date is given in the date parameter then it will copy files with a source time that is newer than the destination time.

Ex: xcopy a.file /d:11/30/04 c:\temp\a.file<f.bat

Since the xcopy command with the /d parameter will ask you if the destination is a file or directory you will need to supply the prompt automatically. You can do this by creating a file (I called it f.bat) that simply has a single character in it (the letter f followed by a return). By using the "<f.bat" at the end of the command you will pump the "f" into the xcopy automatically for the file/directory prompt.



Back to Windows Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums