Computing.Net > Forums > Disk Operating System > DOS copy command without "Overwrite?" message

DOS copy command without "Overwrite?" message

Reply to Message Icon

Original Message
Name: Razzi
Date: September 27, 2000 at 20:02:22 Pacific
Subject: DOS copy command without "Overwrite?" message
Comment:

hi everybody .... ok ...
I have, let say, directory that has files inside like: G:\1999\Jan\ has files file1.txt file2.txt file3.txt . And I also have G:\2000\Jan folder that has only file3.txt . I want to COPY ALL files from G:\1999\Jan\*.* to G:\2000\Jan\ But I DO NOT want to overwirte file3.txt which already exists in G:\2000\Jan folder. SO they question is how to copy all files from one folder to another folder without overwriting existing files AND (here listen very carefully) without giving me a prompt message "Overwrite? Yes, No,ALL". I want to use this command in DOS BATCH file (*.bat) which will work overnite (copy about 30000 files from one to another directory .... and about 1000 files in destination directory already exist and should not be overwritten) and there will be nobody to type "NO" to every "Overwrite??" message.


Thank you every body.


Report Offensive Message For Removal


Response Number 1
Name: W0rm
Date: September 27, 2000 at 21:25:14 Pacific
Subject: DOS copy command without "Overwrite?" message
Reply: (edit)

*yawn*

a lot of you should learn the /? switch.
how would I do it?

like this:

attrib \1999\Jan\file3.txt +s +r +h
copy /y \1999\Jan\*.* \2000\Jan
attrib \1999\Jan\file3.txt -s -r -h

the first command hides the file(s) you dont want copied...then copies the rest (/y suppresses the "overwrite" message and makes it overwrite everything) then the last command un-hides the file(s) you didn't want copied.
- W0rm


Report Offensive Follow Up For Removal

Response Number 2
Name: mr o
Date: September 28, 2000 at 01:26:27 Pacific
Subject: DOS copy command without "Overwrite?" message
Reply: (edit)

attrib with just the +r will make it so it aint copied over.

as an extra you can also set up the dos environment variable

set cpycmd= /y

this is the environment variable that copy looks at each time it is run.

also, dir looks at dircmd

a useful thing i normally do is set dircmd=/w
so all directory listings come out in wide format, and it can simply be overrided by adding the switch /-w


Report Offensive Follow Up For Removal

Response Number 3
Name: Razzi
Date: September 28, 2000 at 04:56:56 Pacific
Subject: DOS copy command without "Overwrite?" message
Reply: (edit)

thank you guys ... I can not apply first method (as it was suggested) because at the moment of copying I dont know exactly how many files should not be overwritten ... And I can not hide ALL of them (~1000 files in different folders such as G:\2000\Jan or G:\2000\Feb G:\2000\Mar ... etc)
I think for the same reason I can not apply second method too.
But I came up with goood idea myself :o)
this what I will (actually I did already) do:

* create G:\temp folder
* copy all existing files from G:\2000\Jan to G:\TEMP\
* copy all files from G:\1999\Jan to G:\2000\Jan in qiet mode (overwriting existing files)
* and finally copy back existing files from TEMP folder all files to G:\2000\Jan.

So basically what I have in G:\2000\Jan --- existing files (that used to be there before all this s---) are not overwritten + plus files copied from G:\1999\Jan.

:o) Thank you guys for the help


Report Offensive Follow Up For Removal

Response Number 4
Name: none
Date: September 29, 2000 at 14:44:01 Pacific
Subject: DOS copy command without "Overwrite?" message
Reply: (edit)

is this a DOS forum? nobody knows that you can just pipe (|) the letter 'n' or any other string to a copy command?????????

enter this command line:

echo n|copy X:\wherever\*.* X:\wherever
^ where this is a pipe character (shift-backslash on most IBM keyboards)


simple.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: DOS copy command without "Overwrite?" message

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge