Questions tagged [xcopy]
The xcopy tag has no usage guidance.
198
questions
88
votes
6
answers
221k
views
Is there a way to xcopy just changed or new files?
I am trying to deploy a website from my desktop to my webserver and so right now I am doing this:
xcopy C:\source X:\destination /s
My desktop is a Windows XP machine, and I need to copy to a ...
43
votes
5
answers
125k
views
What is the benefit of copy over xcopy on the command line?
I know that xcopy has more options however are there any benefits to using copy rather than xcopy?
29
votes
4
answers
42k
views
xcopy files into single directory
I'd like to use xcopy on a Windows machine to pull out all files with .png extension into a single directory.
I tried xcopy C:\folder\*.png /s C:\png\, but it is keeping the sub-directories inside \...
29
votes
3
answers
175k
views
How to copy only new files AND only those that are modified after a certain date?
I would like to copy files from one drive to another, but I only want to copy source files that are newer than the destination file. BUT, I also want to only copy source files that have been changed ...
23
votes
4
answers
69k
views
Copying many files without stopping on errors on OSX
I need to copy several Gb from an external HD to my main HD and some files will cause errors. If I do this with the finder, it will stop on the first error.
Is there a way to copy everything no matter ...
19
votes
7
answers
39k
views
How to copy a directory on Windows, preserving timestamps of all directories being copied
I want to copy a directory tree while preserving timestamps of any file and directory contained therein being copied.
The source directory is on a data DVD (ISO-9660 filesystem). I am copying to an ...
17
votes
2
answers
121k
views
xcopy: move files instead of copy?
I would like to use xcopy to move, not copy files across a network with the Verify flag. I could not find a switch on xcopy to move files, is there an xmove I can use that has verify?
At the moment I ...
11
votes
2
answers
47k
views
Copying only newer files from one folder to another
I have 2 folders with files. These files are the product of some build process.
The first folder is the outputs of previous build while the latter is the output of the current build.
I would like to ...
11
votes
2
answers
44k
views
Why is xcopy returning "invalid number of parameters"?
Under some circumstances, xcopy will return the error Invalid number of parameters without giving you a clue as to what’s going on. The usual solution for this is to be sure that your filenames are ...
11
votes
1
answer
10k
views
XCOPY can't read /EXCLUDE file
I'm trying to write a build script batch file for an Unreal Tournament 2004 mod I want to publish the source code for. This script contains a call to XCOPY with the /EXCLUDE parameter as follows:
...
10
votes
1
answer
14k
views
How to predefine file/directory parameter to xcopy
I need to run xcopy command. But when I type it with all parameters:
xcopy \\<server>.<domain>.com\c$\Users\<user>\Documents\New_ADuser_mustang.ps1 C:\IAM\New_ADuser_mustang.ps1 /C /...
10
votes
3
answers
30k
views
Windows: File copy/move with filename regular expressions?
i basically want to run:
C:\>xcopy [0-9]{13}\.(gif|jpg|png) s:\TargetFolder /s
i know xcopy doesn't support regular-expression filename searches.
i can't find out how to find out if PowerShell ...
9
votes
4
answers
56k
views
How do I track the progress of XCopy command while It's running?
OPSYS: Win10Pro 64 bit
RAM: 10GB
I created a batch file which I then saved to the desktop of the local Administrator account.
The batch file command line is this:
xcopy "F:\movies" "L:\movies" ...
9
votes
1
answer
28k
views
How to use xcopy with relative paths? [closed]
I've tried to use xcopy using relative paths and have had no luck.
I opened a command prompt as administrator. CD'd to my base directory where I want to xcopy a valid file from one location to ...
8
votes
2
answers
36k
views
Using xCopy to create entire folder structure, including root folder name and all files
I looked at quite a few solutions to xCopy questions, and tried many difference
methods. (Various wildcards, paths ending in \, various xcopy switches in various combinations.)
xCopy c:\Public d:\...
8
votes
3
answers
29k
views
Use OneDrive as additional backup location
I'm trying to take advantage of the fact that OneDrive now offers unlimited space, and allows these files to not take up space locally. I already have a backup system in place, but I would like to add ...
7
votes
3
answers
20k
views
Unix equivalent of XCOPY /D
Windows has a nice option to its XCOPY command: /D. This copies only files where the source modification time is newer than the destination time. Is there any unix/linux equivalent of this? I'm trying ...
7
votes
5
answers
22k
views
Files copied using xcopy command are hidden in destination
I copied almost 100GB of files from my laptop to my external drive using the following xcopy command.
X:\windows\system32>XCOPY E:\ "L:\BackupFolder\" /S /E
All the files in E: were copied to ...
6
votes
2
answers
6k
views
RoboCopy slower than Xcopy? (Windows 10)
I'd been using xcopy in a backup script but every so often xcopy would fail with "insufficient memory" when a pathname would sneak into the backup set that exceeded 254 characters. Lots of ...
5
votes
3
answers
74k
views
Copying a directory by retaining its permission
I've located this KB article which explains the topic title. But what my problem is that when I use "xcopy" command; it only copies the contents inside a directory to the new location but not the ...
5
votes
6
answers
5k
views
Incremental/Differential Backup on Windows
What's the easiet way to perform an incremental/differential backup to a network share in Windows?
Does a Robocopy/Xcopy solution work reasonably well (I need to the parameters!) or is there a good ...
5
votes
1
answer
3k
views
XCOPY Behavior copying between remote servers
I am trying to determine the bandwidth usage of XCOPY when copying files between two remote servers.
I am on an XP workstation running a batch file (over a WLAN) which uses XCOPY to copy files from ...
5
votes
2
answers
5k
views
Is it possible to get an `errorlevel 1` from `xcopy` in Windows 10?
Microsoft documentation states that the xcopy exit codes are
Exit code Description
0 Files were copied without error.
1 No files were found to copy.
2 The user ...
4
votes
3
answers
33k
views
XCOPY /Exclude Directory Syntax
I'm trying to use XCOPY to copy a directory that looks like this:
-MainFolder
-ManyFoldersIWantToCopy
-ManyFoldersIWantToCopy
-...
-Source Code
I want to use the /EXCLUDE option to copy every ...
4
votes
6
answers
2k
views
How to copy folders on same NTFS drive using hardlinks?
Is there a way to create hardlinks to create a duplicate of a folder on the SAME drive (NTFS formatted)?
I am looking to do something like this:
XCOPY E:\TEMP\SAMPLE1* E:\TEMP\SAMPLE2\ /s
but INSTEAD ...
4
votes
2
answers
314
views
Backing Up from command prompt
I am trying to backup my system from the command prompt as windows will not boot. I only want to backup documents but i am trouble with the command.
I am using "xcopy c:\documents and settings*.doc ...
4
votes
2
answers
6k
views
Behavior of xcopy when moving files on a network drive
Using a batch file, suppose a directory on a network machine, mapped to a drive with net use.
net use \\"server name"\"share name" y:
Then from that directory
y:
cd archive
An xcopy to another ...
4
votes
4
answers
722
views
Where should I xcopy-deploy my applications on Windows 7?
a customer's I have some applications that are installed with plain xcopy. I know those applications will write some data into their installed directory at runtime. Now I want this application to be ...
4
votes
5
answers
11k
views
Copy files from FAT32 to NTFS, preserving date
I have a FAT32 flash drive full of old archived emails, and their creation/modification date is important because it represents when the email was received. I'm trying to copy these over to another ...
4
votes
1
answer
11k
views
Batch execution error "not recognised as an internal or external command"
D:\temp\copyTXT.bat is a simple script containing:
XCOPY /v D:\temp\MyFile.txt D:\Documents\
Executing the script fails, flashing a window for ~100ms, then does nothing (no copy at all), but if I ...
4
votes
0
answers
87
views
Unable to Copy from E partition
I am stuck in weird issue. I moved my images from my phone to a folder in Windows 8's Partition E:/. Now i am trying to move back to my Phone/Flash Drive/Other Partition/Other Machine(via Sharing ...
4
votes
1
answer
7k
views
Xcopy not creating source folder on target drive
I'd like to copy this folder:
c:\temp\test
to
e:\backup
with
xcopy c:\temp\test e:\backup\ /S
and I expect to get everything in this folder:
e:\backup\test
Not so. The files from TEST ...
3
votes
3
answers
24k
views
XCOPY not copying directories
I am trying to copy one directory to another directory. It seems I can copy a file but directories won't copy.
Running this at cmd:
XCOPY C:\Drivers C:\Users\lenovo\Desktop
Gives
0 File(s) copied
3
votes
1
answer
5k
views
xcopy only copy subdirectories with their contents
As the title says...
An example:
I have these files & dirs:
c:\file.txt
c:\a\somefile.txt
c:\b\anotherfile.txt
And with some magic I want this structure on the destination:
d:\a\somefile....
3
votes
3
answers
16k
views
How to copy one directory to another with window command prompt?
I read alot of guides about to copy directories. On SO also read the posts
Commmand line command to copy entire directory (including directory folder) to another directory
copying all contents of ...
3
votes
3
answers
25k
views
Merge directories without overwriting conflicts
I have 2 directories structures (A and B) that normally don't overlap. I want to merge A into B.
The following command will merge the directories:
xcopy A B /E /Y
However, I want to be able to ...
3
votes
1
answer
5k
views
Copy folder structure on Windows except for one folder with files
I need to copy folder structure without files except for one sub-folder. That is I want to copy the folder structure without files plus only one of the sub-folder to be copied with its content.
I can ...
3
votes
3
answers
10k
views
Windows XP xcopy files with extensions recursively
I have a single-line script that copies all ".ext1" files from current folder to destination folder recursively:
xcopy *.ext1 D:\dest /s /d /y
It works perfectly.
Now I want to copy all *.ext2 as ...
3
votes
5
answers
43k
views
How to optionally copy and rename a file in Windows?
Basically, in an automated batch file, I want to copy and rename a file if the destination file is missing or older. There are several variants, which do not quite work:
copy /Y c:\source\a.file c:\...
3
votes
2
answers
9k
views
Mapped drive is not accessible, to copy files, using Task Scheduler
On my Windows Server 2008 R2 machine, a batch file is scheduled to run using Task Scheduler. For some reason, only a portion of the commands in the batch file are executed; Some MS DOS commands are ...
3
votes
4
answers
11k
views
Looking for a way to copy a file that does not lock the file being copied
I am aggregating together data that is being generated at a bunch of disparate sources, in a mixed environment of various versions of windows (xp/7) and one linux (centos). The data is available via ...
3
votes
1
answer
150
views
Spaces in FOR /R output
I need to copy a file C:\plst.m3u into all subfolders of C:\Music. I'm using this command:
FOR /R "C:\Music" %G IN (.) DO xcopy "C:\plst.m3u" %G
It works, but only for the paths, which doesn't ...
3
votes
2
answers
20k
views
Copy from one location to another using batch script based on modified date and also newly added files in source
How to copy files which are modified and the new ones that are added in the source location to the target location using a batch script? The existing files that are already present in the target ...
3
votes
2
answers
2k
views
Possible to copy files and directory structure but don't copy file contents (i.e. 0 byte file size)?
I'm wondering if it's possible to copy files and directory structure, but don't actually copy file contents. I want to copy over file names and extensions but have each individual file be 0 bytes in ...
2
votes
5
answers
14k
views
xcopy Not Surpressing File/Directory Query
I'm attempting to use xcopy to copy over a file from one machine to another on our network as part of a Java program. I'm calling xcopy like this:
xcopy "C:\Program Files\path\to\my\file" "\\...
2
votes
4
answers
3k
views
Backup Important Windows files to USB drive
A person I know who is not very good with computers wants to have an easy way of backing up important files on Windows, with the ideal process being:
Plug in USB drive
Click on Desktop shortcut
Have ...
2
votes
2
answers
2k
views
Is there Windows copy command that mimic Unix `cp -r` behavior?
I don't know how to name this behavior vividly, just call it loyalcopy.
Two figures will illustrate it clearly.
I'd like to issue two commands to copy two filesystem nodes (regardless it is a file ...
2
votes
2
answers
13k
views
Wildcard file extensions xcopy
I have some files that need to be copied to a directory on a schedule. All the files have the same name but the extension increments (I have no control over this, it drives me mad)
I've tried ...
2
votes
3
answers
5k
views
can't exclude path with a space (xcopy)
I'm trying to use xcopy /exclude:exclude.txt and one of the paths in exclude.txt has a space in it and it's not working. Is there any workaround for this?
2
votes
1
answer
81
views
Copy several files and send each to a specific subfolder
I have a folder containing CD covers in .jpg and another folder containing subfolders, each with the corresponding CD. I want to send each CD cover to its corresponding subfolder. They are already ...