Questions tagged [xcopy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
3k views

Xcopy: why /x (System Access Control List information)

I can't get more info about the /x switch than: This option copies file audit settings and System Access Control List (SACL) information. You imply /o when you use the /x option. I am trying to ...
Ludo's user avatar
  • 87
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 ...
Islam Mohamed's user avatar
2 votes
2 answers
731 views

xcopy.exe exists in every Windows system?

Can I be sure that xcopy.exe exists in every Windows system (7+) and that it can always be found in the system PATH (e.g. C:\windows\system32)?
user1580348's user avatar
  • 1,678
2 votes
1 answer
1k views

What's wrong with my XCOPY line?

I'm trying to write a batch file that will copy all new files from a source to a destination without prompting (it will be running on a server). This script will not copy files that already exist in ...
Michael A's user avatar
  • 193
2 votes
3 answers
2k views

Running a certain XCOPY command without user interaction

I am trying to run the following command in Windows CLI: XCOPY Z:\.vimrc %USERPROFILE%\_vimrc /H The /H part needs to be there because Z:\.vimrc is a hidden file. When I run the command above, I ...
Matt Alexander's user avatar
2 votes
2 answers
23k views

xcopy and invalid drive specification

I am trying to use xcopy and it always returns with invalid drive specification xcopy "C:\socp.tar" "\\FMDX1024\C\socp.tar" FMDX1024 is a machine on the network. any clue?
raskolnikov's user avatar
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 ...
Zhro's user avatar
  • 877
2 votes
1 answer
222 views

Share a folder with user 'Everyone' without asking to login?

I shared a folder on a WinServer2012 with username 'Everyone' for read/write. From XP it doesn't ask for login, while from Win7 login box pops up. How to accomplish to not being asked from Win7 too? ...
Hrvoje T's user avatar
  • 1,949
2 votes
1 answer
24k views

XCopy encounters a sharing violation, how to handle

I'm using xcopy for copying large bundles of files. One thing I particularly like about xcopy is the /F switch which shows all source and destination files, paths included, something like: xcopy /E /...
Dominique's user avatar
  • 2,193
2 votes
1 answer
1k views

batch copy folder located by guid

In a batch file, can I copy a folder located by a constant path like \?\Volume{GUID}? When copying (copy, xcopy or robocopy) a directory and its content from a local removable drive (a usb external ...
fkk's user avatar
  • 21
2 votes
1 answer
20k views

How to use Robocopy to copy a folder structure into all (sub)folders located under one directory?

Is there anyway for me to quickly take an empty folder structure I have created on my desktop and copy it to 488 other folders all located on a network drive but in the same folder? My primary ...
small3687's user avatar
2 votes
1 answer
1k views

XCopy on server?

Normally, on my website, files are either handled by WordPress or by me doing FTP. I'd like to copy my entire site to a new folder. I don't want to copy it down to my local drive (with wget) and then ...
Robert Frank's user avatar
2 votes
1 answer
537 views

xcopy invalid parameters - copying all files in folder

for /R "c:\" %f in ("*.pdf") do xcopy %f "%USERPROFILE%\all\text" /s /c /d /e /h /i /r /y This is the command I am using to copy all of the .pdf files on my computer into one folder. However, it does ...
ss.benjamin's user avatar
2 votes
1 answer
807 views

Batch File XCOPY Invalid number of parameters

I'm trying to create a backup batch file, it's been a number of years since I last did one and I'm having a bit of trouble. I am creating a folder in one location with the date and time in the folder ...
ShadesUK's user avatar
2 votes
1 answer
435 views

copy file in 8.3 format produces "There is already a file with the same name in this location" error in windows 7

I use xcopy and batch scripting to backup newer files xcopy "src" "dest" /O /X /E /H /K /I /D. I was asked if I want to replace something which should not happen. So I did the copy process manually ...
dkeck's user avatar
  • 243
2 votes
2 answers
9k views

Administrator getting "access denied" - unable to create directory

As far as I can tell, I am in the Administrators group on Windows 7 Service Pack 1. With CMD prompt pinned to my Start menu, I rightmouse and select Run as Admin and get this error on xcopy: C:\&...
John Adams's user avatar
2 votes
2 answers
2k views

How to Copy File and Folder permissions but not folders and files?

I have two copies of same folder in windows. but the permissions of one of them are missing. How can I copy permissions of the original source to other? I know I can use the xcopy command but the data ...
Ahmad's user avatar
  • 85
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 '...
Iceking007's user avatar
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 ...
user263358's user avatar
2 votes
1 answer
65 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 ...
Mark Schultz's user avatar
2 votes
2 answers
2k views

copy array in a batch file

I have several files located across several directories/subfolders that I need to copy to several destinations. I currently do this using xcopy but I do it line by line, so there are several lines of ...
Mike Van Dunk's user avatar
2 votes
0 answers
3k views

How can I specify an /EXCLUDE file with spaces in it to xcopy?

I have tried to specify an /EXCLUDE filename with spaces in it to xcopy, but it always chokes. How can I specify such a path to xcopy without copying the /EXCLUDE files into the current directory and ...
binki's user avatar
  • 758
2 votes
1 answer
365 views

XCOPY Copied files and folders as a file

Today i had some problems with a laptop, and i had to reinstall the windows on it, while i was in the recovery console, i used XCOPY batch command to copy files and folders from c:\users\USERNAME\*.* ...
Nutterz's user avatar
  • 23
1 vote
3 answers
22k views

Can xcopy make a bootable copy (clone) of Windows?

Following on from my discussion with @JustinD in the comments here, is it technically possible to simply xcopy the contents of a Windows partition to a partition freshly created and formatted on a new ...
Karan's user avatar
  • 56.5k
1 vote
2 answers
899 views

Copying files from somewhere within a directory tree to a folder

I have a mirror of a large website that I need to reorganize, most of the images and files I've been able to programmatically move and relink up; however, there are a few (few is a relative term, we'...
user avatar
1 vote
2 answers
3k views

Getting access denied on the destination drive partition after using xcopy

I wanted to copy the all the files in a folder including its sub-folders from one hard drive to another I tried this xcopy command C:\Documents and Settings\rakesh>xcopy "D:\Ganesh Drive\Trimax ...
Ganesh Dake's user avatar
1 vote
2 answers
4k views

How to copy directory structure, by only two levels but not the third?

From XP's Command Prompt, I am using XCOPY to copy directory structure of s:\bloo\"[8family]\"[30-40genus]\"[5species]\ and want to limit the structure to just the genus and families, and ignore the ...
mfg's user avatar
  • 627
1 vote
1 answer
670 views

How can I keep XCOPY from copying more than it should?

I have a script for copying files from one folder to another. The XCOPY command looks like this: XCOPY /E /Y /V /D:%date% %reportsDataPath% TMP\ The date flag is supposed to make it copy only files ...
user2331063's user avatar
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 ...
Howiecamp's user avatar
  • 1,578
1 vote
1 answer
3k views

Does appending (merging) files together work with XCOPY?

I want to merge multiple (text) files having the same prefix into a single file. This task is part of a whole batch (in VBScript) but due to performance expectations, I'm more likely to use a native ...
maxxyme's user avatar
  • 551
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 ...
DWR's user avatar
  • 111
1 vote
1 answer
11k views

Batch file to only copy new files from source to destination [closed]

I am trying to create a batch file that copies only new files to another folder. I have .png files that come in through FTP at various times throughout the day. So I am looking for a .bat that I can ...
Kevin Brekke's user avatar
1 vote
2 answers
10k views

What's the correct syntax for using an IP address in xcopy?

I want to copy a set of files on a Windows computer to a number of Windows servers I have credentials for without having to go through RDC, theoretically a simple task. For this usage, the appropriate ...
Shay Guy's user avatar
  • 213
1 vote
1 answer
3k views

How to avoid XCopy run into the error: The process cannot access the file because it is being used by another process?

I am xcopying data from my local directory to a shared windows drive. Once in a while i get an issue where in the middle of copying i see the following error: The process cannot access the file ...
leora's user avatar
  • 6,123
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 ...
Fidumo's user avatar
  • 25
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 ...
snappy_pete's user avatar
1 vote
1 answer
106 views

What's going on with xcopy /d

What exactly is under the hood of the /d flag? what is the code doing? Reason I'm asking is that I can't tell definitively if /d is reading the entire file from source or just some header. Thank you!
Alex Vazquez's user avatar
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 ...
M. Guillaume's user avatar
1 vote
1 answer
4k views

Copying files based on creation/modified date

I have a question about backing up files from the command line. We have a shared folder (stored on one of the computers) in the office containing several thousand files and subfolders. Until now, I've ...
stoyian0v's user avatar
1 vote
1 answer
727 views

Copied empty folder on top of C:\ using xcopy - what happened?

I was testing xcopy on Windows 10 for use in scripts and, in haste, I run: xcopy /s /e /y /x "%~dp0/aaaaaaaaaa" "C:/" where aaaaaaaaaa is an empty folder. /s /e /y /x does the copy recursively, ...
mpliax's user avatar
  • 23
1 vote
1 answer
1k views

Copy subfolders and their content up one level?

Right now I have the following structure Folder 1\ -Apr2007\folder 1 \folder 2 \folder 3 -May 2007\folder 23 \folder 24 \folder 25 ...
user9687306's user avatar
1 vote
1 answer
1k views

Windows XCOPY results from FIND command

Windows 7 CMD I can retrieve a list of files by the following command dir /b | find "TENDER_NUM 2". I'm trying to copy all the files that were returned by find into another folder. I've tried: for /...
BardsWork's user avatar
  • 141
1 vote
1 answer
4k views

Windows cmd copy directories and content recursively if the files do not exist

The question fits in the title: I want to copy from local storage to a network storage directories and their content, but only the new or updated files with no prompt. My idea would be to use xcopy ...
user69453's user avatar
  • 247
1 vote
1 answer
2k views

"Copy but keep both files" but only for files with different timestamps

I'm trying to consolidate 5 very similar but slightly different tree structures into a single one but not lose any modified data. So, I need a solution that will: 1. Copy files that exist in the ...
mythofechelon's user avatar
1 vote
3 answers
5k views

Batch file, copy files beginning with (A,B,C,D,E)

Instead of running xcopy 6 times, is there a way to define an array of files to copy? xcopy \\\from_location\\(A,B,C,D,E)*.txt \\\to_location\
SUpermammal's user avatar
1 vote
2 answers
238 views

Copy Windows directory, including specified directory

I want to copy the directory itself, not only the contents. For example I have C:\DirA\SubDirA\FileA I want to copy DirA into DirB so that I have C:\DirB\DirA\SubDirA\FileA Here's what I've tried ...
David's user avatar
  • 635
1 vote
1 answer
315 views

Is the order of options for xcopy command important?

Is there a difference between these two lines?: xcopy C:\source X:\destination /s /d xcopy C:\source X:\destination /d /s I've noticed that with the first one I also copy newer files in subfolder, ...
Sergio's user avatar
  • 11
1 vote
1 answer
727 views

Copy my documents without rename in windows 7

All, Occasionally I use xcopy or robocopy to copy my documents folder as a backup. The issue is no matter what I name it, say MD_Backup, Windows always renames it to My Documents. I'd really like it ...
Jeffrey Bane's user avatar
1 vote
1 answer
410 views

Xcopy batch file behavior

I have the following backup batch file: xcopy C:\test.txt \\server\Data\user\"data test" /e /y /i Why does it not only copy the file listed but proceeds to copy the whole root directory? When I ...
piagetblix's user avatar
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?
Meester Moo's user avatar