Questions tagged [xcopy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
39 views

Suspiciously fast XCOPY on 2nd CD

I'm checking the integrity of my 'Old projects' CDs/DVDs with XCOPY *.* /s to my hard disk. I have two copies of each CD/DVD, so the first copy goes to Folder1, the second to Folder2, and then I ...
1 vote
1 answer
4k views

Batch File to xcopy multiple files from web server to share drive

I am trying to copy a group of files from a folder on my SharePoint site to a network share folder for manipulation "off-line". I am new to xcopy and batch files so trying to teach myself with Google!...
-1 votes
1 answer
37 views

What is causing the xcopy file from having an error in it?

I am new to xcopy. I am trying to move a file that is in excel format to a new destination and as a csv file. I have to do this so that the DMExpress ETL job can move the file and then read it. This ...
0 votes
3 answers
3k views

Why does copy work where Xcopy and Robocopy does not work?

Network admin allowed me to read-access only 1 file from a subfolder of a shared folder on a server and I don't have permissions to even view upper level folders, but when I open that folder I can see ...
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 ...
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 ...
0 votes
1 answer
4k views

Can't Copy To Network Drive Using XCopy

I'd like to copy the contents of D:\Documents (a folder on a local hard-drive) to Z:\Documents (a folder mapped to a NAS device). xcopy.exe D:\Documents Z:\Documents /d /s /y /d - copies all Source ...
1 vote
2 answers
2k views

How to maintain relative symbolic links during copy?

I have a directory structure with a bunch of relative symbolic links. Example: e:\test e:\test\foo\a --> "..\bar" e:\test\bar\b --> "..\foo" Is there a way to copy the entirety of the directory from ...
0 votes
1 answer
70 views

Copy several files listed in a text file to a new folder when list file contain different paths

I would like to copy several files (with different paths) in one folder. I tried this solution explained here page of example on stackexchange but when I run the file (I choosed .bat file) I have &...
19 votes
7 answers
38k 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 ...
6 votes
2 answers
5k 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 ...
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
1 answer
16k views

How rename files copied via Robocopy if it exist but with different modify date

I'm using Robocopy to copy files from a folder to another, i think my code will overwrite the file if it was existing on the destination folder and the timestamp was different, what im trying to do is ...
3 votes
3 answers
24k 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 ...
0 votes
1 answer
3k views

How to generate a logfile using xcopy with task Scheduler - no bat file

I'm updating some files every day with task scheduler using xcopy. My syntax is xcopy "\\networkFolder...\" "c:\folder" /D /Y /E /I > c:\users\name\desktop\logfolder\log.txt It works perfectly ...
1 vote
1 answer
2k views

Robocopy Hangs / Gets Stuck - Move to Next File Command/Timer?

I have an issue when I utilize Robocopy. I have a fairly homogeneous directory and I am trying to move it from one drive to another. The drive where the files reside must be corrupted. I would ideally ...
0 votes
0 answers
270 views

How to use xcopy to copy files from a compressed NTFS folder to the root of a FAT32 volume?

I am having problems using XCOPY to copy folders and files from a compressed NTFS folder to the root of a FAT32 volume (actually a USB drive). This looks like a Windows or Xcopy bug to me. The command ...
0 votes
0 answers
102 views

Is my batch script to replace program files on startup with rmdir and xcopy not working properly?

I'm trying to work my way around a program that's giving me some problems. It has to fire up every day and do it's thing, but rarely does - losing data and breaking very frequently. So to counter this,...
3 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 ...
0 votes
1 answer
984 views

How to use xcopy with /exclude in a network path with spaces?

I want to use xcopy on a network path. I actually do. The problem is that I wanted to use an /exclude option. But the file would be in a network path. But the network path has spaces (s:\my path). So ...
1 vote
1 answer
308 views

Is it possible to make XCOPY only copy the files from a source if they are older than the ones in the destination?

Is it possible to make a batch script only XCOPY the files from a source if they are older than the ones in the destination? I'm trying to archive Roblox versions. I tried /D, but that just makes it ...
1 vote
1 answer
9k views

How to copy entire folders/directories in command prompt?

My laptop isn’t booting, so I’m running a Windows ISO off a DVD and attempting to backup some files to an external hard drive plugged into the USB via Command Prompt. With command prompt I can enter ...
1 vote
1 answer
901 views

Does the xcopy command on Windows provide a safe means of backing up data?

I recently backed up the data on my computer, using the xcopy command. I briefly looked through some of my backup files and directories, and they looked the same as the originals. However, I ...
0 votes
2 answers
7k views

xcopy command does not work in a batch file

The command below works in CMD Prompt, but does not work in a batch file. xcopy "D:\Desenvolvimento\Repositórios GIT\driverXD\app\*" driverxd\ /e
0 votes
2 answers
586 views

Folder Size after copy way too big

I have been trying to copy the DESKTOP folder of a User for backup purposes, but once it finishes its way to big. Source folder size is 21.0GB on properties (55k files) Destination folder after copy ...
5 votes
2 answers
4k 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 ...
1 vote
1 answer
1k views

xcopy only newest file to a subdirectoy

I have a batch file that runs when I build my solution in VS2019. The .bat file uses xcopy to copy .dlls from my project's Debug folder to another destination direction. I want to use xcopy to copy ...
29 votes
3 answers
41k 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 \...
1 vote
0 answers
964 views

Purpose of xcopy over robocopy

From what I've found online, robocopy seems to be xcopy with more features; are there any scenarios where someone would want to use xcopy over robocopy?
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 ...
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 ...
2 votes
1 answer
824 views

Change extension for all files in a folder & its subfolder

I am using XCOPY the following successfully copies the entire contents of \MY SKETCHES 2021 to \My Sketches (TEXT). This is my command: xcopy C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\My ...
0 votes
1 answer
181 views

Batch file not getting the first 5 characters in drop file filename

I created a simple batch file that copies drop file in specific folder. This my batch script: rem This will create a BACK-UP DATA Folder in Desktop rem with a SUB-FOLDER which filename must be the ...
0 votes
1 answer
72 views

How to schedule a backup for only the new added files?

I'm a Windows user and wondering: how can I do a backup for the files on a specific folder if the files are not older than x days? Or to backup only the newly added/modified files without doing a full ...
0 votes
3 answers
4k views

Batch file XCOPY cannot find existing directory

I'm writing a small batch file to copy my C# project to another drive. I'm using XCOPY to copy an entire folder (We have some XP machines still, so robocopy isn't an option). However, when I run the ...
0 votes
0 answers
130 views

for command does not allow move or xcopy command to move/copy the folder only the contents

have looked on this forum for several examples, started off with xcopy ( not allowing wildcards in the folder name ), wanted to pipe the dir command to either xopy or move but require the dir ...
1 vote
1 answer
562 views

copy big file to multiple locations at the same time

I am trying to use a CMD command prompt to copy a big file (1.5G) from one location to multiple destinations at the same time. Is there a way to do this using COPY/XCOPY etc? I haven't been able to ...
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 ...
0 votes
1 answer
1k views

Invalid drive specification - Xcopy with long path names - \\?\C:\Some\Really\Long\Path

I'm unable to use the above mentioned convention. The command that I'm using: Xcopy \\?\c:\108 \\?\c:\108_2 /e /h /r /y An error invalid drive specification is received. What am I missing
0 votes
1 answer
65 views

copy folders and content to a external drive

i have this for /F "delims=" %%a IN ('dir /b /s /ad "*"') DO ( FOR /F %%c IN ('dir /b/s "%%a\*.txt" ^') DO XCOPY "%%a" "J:\" ) but it only moves the ...
2 votes
2 answers
283 views

How do I automatically copy data when attaching external storage?

If I am correct to assume that once I place a DVD/disk in my optical drive (or use a USB flash drive or external HDD for that matter; for arguments sake) that this action would in effect trigger an '...
2 votes
2 answers
660 views

XCOPY file verification fails on a symbolic link but diff shows now difference between files

I'm performing an xcopy backup of a disk on Windows using the following command line: xcopy "d:\" "r:\" /v /h /k /e /b /d I know that the verify switch doesn't do much but a file ...
2 votes
1 answer
64 views

Copy files except when destination modified in last x days

I think what I am trying to do is simple, but I can't get the robocopy settings right, as I am trying to copy files from src to dest, over-writing files in dest if they already exist, except if ...
43 votes
5 answers
123k 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?
1 vote
2 answers
4k views

How can I merge two directories in Windows and have the result contain the most recent files and directories?

I believe this question to be very simple however I want to triple check before I screw myself up. My testing has shown this process to work (I think, but I may be missing something) but again I'd ...
0 votes
1 answer
239 views

Does XCOPY leave credentials cached in LSASS?

When using XCOPY to copy files to a remote machine, are your credentials used to connect to the remote machine cached in the LSASS of that machine? I am trying to avoid leaving any credentials ...
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 ...
0 votes
1 answer
83 views

xcopy only working if I use /F to display full filenames

I was initially just using copy but I got this output: C:\repos\AutomatedBuildTesting (master -> origin) (2020-09-18 8:49:01.12) λ copy ".hooks/*" ".git/hooks/*" commit-msg The ...
-1 votes
4 answers
2k views

How to create a USB that copies all photos from PC to which it is connected, using Batch files?

I tried doing this, but it is not working :: variables /min SET odrive=%odrive:~0,2% set backupcmd=xcopy /s /c /d /e /h /i /r /y echo off for /r C:\ %f in (*.jpg) do @copy "%drive%\all\pics" @echo ...
3 votes
3 answers
9k 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 ...