Questions tagged [xcopy]

xcopy is a Windows command to copy all files, directories, and subdirectories from a specified path to a target directory

Documentation:

  1. TECHNET
  2. SS64

Related commands:

  1. COPY
  2. ROBOCOPY
797 questions
35
votes
6 answers

Batch file to run xcopy without overwriting existing files

I need my program to run: xcopy s:\* z:\ /E When xcopy runs, it will prompt if a file needs to be overwritten, so I want the batch file to answer no in all cases to the prompt. How can I accomplish this?
Eae
  • 4,191
  • 15
  • 55
  • 92
35
votes
8 answers

xcopy is not recognized as an internal or external command, operable program or batch file

I have a problem using 'xcopy' command. I'm building a C# project with msbuild. At the end of the build, a batch file is called to copy my assemblies from Debug/Release to some other folders. Here is the problem, my build fail and the error log is…
Alk
  • 658
  • 2
  • 12
  • 23
31
votes
6 answers

Batch - copy file using relative path

I'm a beginner with batch. I would like to copy file in \Debug\test.ext into ..\..\new by batch command. I tried copy "\Debug\text.txt" "..\..\new", but get error "the system cannot find the file specified"
Dan
  • 339
  • 1
  • 3
  • 6
30
votes
4 answers

Powershell Copy-Item but only copy changed files

I am trying to recurse through a directory and copy it from A to B. That can be done with the following: Copy-Item C:\MyTest C:\MyTest2 –recurse I want to be able though to only copy new files (ones that exist in src but not dest) and also only…
James Turns
29
votes
3 answers

How to use xcopy to only copy files if they are newer?

I have many web applications in a Visual Studio solution. All have the same post build command: xcopy "$(TargetDir)*.dll" "D:\Project\bin" /i /d /y It would be useful to avoid replacing newer files with old ones (e.g. someone could accidentally add…
Junior Mayhé
  • 16,144
  • 26
  • 115
  • 161
28
votes
3 answers

Xcopy Command excluding files and folders

I want to copy files and folders in a directory to another folder excluding a list of files and folders.Is that possible. I was just trying to copy excluding file : xcopy c:\t1 c:\t2 /EXCLUDE:exclusion.txt But it keeps saying read cant read file…
sohel14_cse_ju
  • 2,481
  • 9
  • 34
  • 55
27
votes
5 answers

Hide XCOPY confirmation of number of files copied

I've had a look at the switches for XCOPY and can't seem to find one that suppresses the confirmation of the number of files that have been copied. Do you know if this is possible? Thanks in advance, Dave
Kungfauxn00b
  • 567
  • 2
  • 5
  • 14
26
votes
3 answers

xcopy directories and subdirectories recursively and filter only filenames by extension

Here is what i have for now: xcopy "c:\projects\SampleProject" "c:\temp\copytest" /E /H /EXCLUDE:elist.txt It does all the job i need except filtering filenames by extensions. For example: copy all *.exe files from c:\temp\copytest and…
DxCK
  • 4,402
  • 7
  • 50
  • 89
24
votes
1 answer

"invalid path 0 files copied" Error while using xcopy command

Hi I have this little command to copy files in a batch, which will help because I do this specific copy multiple times a day. The problem occurs while using the xcopy command. Everything is in order, but I am receiving this error: "Invalid path 0…
frontin
  • 733
  • 2
  • 12
  • 28
24
votes
1 answer

Why does my .NET 4 application know .NET 4 is not installed

I developed an application that targeted .NET 4 the other day and XCOPY-installed it to a Windows XP machine. I had told the owner of the machine that they would need to install .NET Framework 4 to run my app and he told me he did (not a reliable…
Tergiver
  • 14,171
  • 3
  • 41
  • 68
23
votes
6 answers

What's causing xcopy to tell me Access Denied?

The postbuild task for one of our solutions uses xcopy to move files into a common directory for build artifacts. For some reason, on my computer (and on a VM I tested), the xcopy fails with "Access Denied". Here's what I've done to try and…
OwenP
  • 24,950
  • 13
  • 65
  • 102
23
votes
4 answers

Using xcopy to copy multiple files/directories, some of which have spaces

I'm trying to use xcopy to copy over several files and directories onto an external hard drive. The following command works fine... xcopy d:\location\folder /e ... except it's not copying over any files/directories withing d:/location/folder that…
MT3
  • 1,065
  • 3
  • 13
  • 22
20
votes
3 answers

VS 2012: Post Build xcopy error 2

i want to make VS copy the .lib-file it created after the build process to a specific folder. So i went to the project config, post-build event, and entered the following command: if exist $(TargetPath) xcopy "$(TargetPath)"…
Juarrow
  • 2,232
  • 5
  • 42
  • 61
19
votes
9 answers

False 'Sharing Violation' Xcopy error message

I am running a batch script (on computer A). The script copies several files from another computer (computer B) to computer A. When the batch script is run, it reports it is unable to xcopy some files from computer B to its own directories due to…
Fractal
  • 1,748
  • 5
  • 26
  • 46
18
votes
4 answers

Using xcopy to copy files from several directories to one directory

Is it possible to use xcopy to copy files from several directories into one directory using only one xcopy command? Assuming that I have the directory tree root\Source\Sub1\Sub2 I want to copy all .xml files from the directory root\Source including…
Oddleif
  • 751
  • 3
  • 9
  • 35
1
2
3
53 54