Windows Commands: Copy one or more files to another location


COPY-Windows Command

COPY

Copy one or more files to another location

Syntax
COPY source destination [options] COPY source1 + source2.. destination [options]

Key source : Pathname for the file or files to be copied.
/A : ASCII text file (default) /B : Binary file copy - will copy extended characters.
destination : Pathname for the new file(s).
/V : Verify that the new files were written correctly.
/N : If at all possible, use only a short filename (8.3) when creating a destination file. This may be necessary when copying between disks that are formatted differently e.g NTFS and VFAT, or when archiving data to an ISO9660 CDROM.

/Z : Copy files in restartable mode. If the copy is interrupted
part way through, it will restart if possible. (use on slow networks) /Y : Suppress confirmation prompt (Windows 2000 only) /-Y : Enable confirmation prompt (Windows 2000 only)

Prompt to overwrite destination file

NNT 4 will overwrite destination files without any prompt, Windows 2000 and above will prompt unless the COPY command is being executed from within a batch script.

To force the overwriting of destination files under both NT4 and Windows2000 use the COPYCMD environment variable:

  SET COPYCMD=/Y
This will turn off the prompt in Win2000 and will be ignored by NT4 (which overwrites by default)

Binary copies
"COPY /B ... " will copy all the files in binary mode , you can also put /B after any one file to copy just that file in binary.

Combine files
To combine files, specify a single file for the destination, but multiple files as the source. To specify more than one file use wildcards or list the files with a + in between each (file1+file2+file3)
When copying multiple files in this way the first file must exist or else the copy will fail, a workaround for this is COPY null + file1 + file2 dest1

COPY will accept UNC pathnames

Examples:

In the current folder
COPY oldfile.wp newfile.doc

Full path specified
COPY g:\department\oldfile.wp "c:\Files to Convert\newfile.doc"

Specify the drive and filename (assumes the current folder on both drives is correct)
COPY a:oldfile.wp c:newfile.doc

Specify source only (will copy the file to current folder, keeping the same filename)
COPY g:\department\oldfile.wp

Quiet copy (no feedback on screen)
COPY oldfile.wp newfile.doc >nul

Other Windows 98, Windows XP Commands:
addusers , arp , assoc , associate , at , attrib , browstat , cacls , call , cd , change , chkdsk , chkntfs , choice , cipher , cleanmgr , clip , cmd , color , comp , con2prt , copy , date , defrag , del , delprof , dir , diruse , diskcomp , diskcopy , doskey , dsadd , dsmod , echo , endlocal , exit , expand , expand , fc , fdisk , find , findstr , for , forfiles , format , fsutil , ftp , ftype , global , goto , help , hfnetchk , if , ifmember , ipconfig , kill , label , ldifde , local , logevent , logoff , logtime , mapisend , md , mem , mode , monitor , more , mountvol , move , moveuser , msg , msiexec , msinfo32 , mstsc , munge , mv , nbtstat , net , netdom , netsh , netstat , netsvc , now , nslookup , ntbackup , ntrights , path , pathping , pause , perms , ping , popd , portqry , print , prncnfg , prnmngr , prompt , pushd , qgrep , rasdial , rasphone , rd , rdisk , recover , reg , regedit , regsvr32 , rem , ren , replace , rmtshare , robocopy , route , runas , rundll32 , sc , schtasks , sclist , scriptit , set , setlocal , setx , share , shift , shortcut , showgrps , showmbrs , shutdown , sleep , soon , sort , start , su , subinacl , subst , tasklist , time , timeout , title , touch , tracert , type , ver , verify , vol , where , whoami , windiff , winmsd , winmsdp , wmic , xcacls , xcopy ,
Live2Support.com :
Product - Benefits - Features - How Does it Works - Pricing - SSL Certificates - Signup - Contactus - Login - Submit Resources