Discussion Locked

File relocate, move, in DOS session

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Using a Dos program in win 95,98, does a method or utility exist that can prevent overite warning and failure of batch command designed to relocate (archive)a file to a directory that already contains a duplicate file name? Something like recycle bin functioning wharein a duplicate name in target dir still allows command to succeed

3 replies

by pschuvie

The Dos commands of copy, xcopy, and move all have a /Y switch which when used eliminates the prompting for do you want to overwrite and proceeds with the action without further intervention.

To see the parameters of these open a DOS session change to the c:\windows\command directory and type copy /? for a listing of switches available.

If you want to provide a safety level, always a good practice, then you would create in the batch the action to locate the file, if exist copy the file toxyz.old, delete the original file, and then copy the new file to where the original file was. If the original file did not exist then you would just proceed with the copy action.

Either way the copy or move actions can be modified to prevent prompting with the Y switch.

Hope this helps.

This discussion is closed to new replies.