Questions tagged [xcopy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
25 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 ...
user avatar
1 vote
1 answer
53 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 ...
user avatar
  • 25
1 vote
1 answer
67 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 ...
user avatar
1 vote
1 answer
99 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 ...
user avatar
1 vote
2 answers
221 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 ...
user avatar
  • 5,125
0 votes
0 answers
127 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?
user avatar
2 votes
1 answer
32 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 ...
user avatar
0 votes
1 answer
68 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 ...
user avatar
0 votes
0 answers
16 views

Can I have robocopy delete absent files?

I'm setting up a drive to backup my data. I easily copied over the files using robocopy. But now I'm thinking about how to manage this when I come back in a month to update my backup. Sure I can ...
user avatar
0 votes
0 answers
69 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 ...
user avatar
0 votes
1 answer
407 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
user avatar
0 votes
1 answer
50 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 ...
user avatar
2 votes
2 answers
306 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 ...
user avatar
  • 776
1 vote
1 answer
216 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 ...
user avatar
  • 11
2 votes
1 answer
47 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 ...
user avatar
0 votes
1 answer
134 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 ...
user avatar
1 vote
1 answer
7k 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 ...
user avatar
0 votes
1 answer
55 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 ...
user avatar
0 votes
1 answer
68 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 ...
user avatar
  • 1,870
0 votes
2 answers
927 views

XCOPY only files from a parent folder and from all its subforlders to a new folder in Windows?

I was searching a lot of times how to copy all the files of different extensions from a folder and all its subfolders to a new folder without copying the folders itself using Batch File. I mean ONLY ...
user avatar
1 vote
1 answer
21 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!
user avatar
1 vote
0 answers
200 views

xcopy in task scheduler ends with error 4

I created a task in task scheduler to copy a specific file to a server each midnight. When I run the command normally in command line it works fine, but the task always ends with exit code 4 and the ...
user avatar
2 votes
1 answer
4k 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 /...
user avatar
1 vote
1 answer
328 views

Batch file with xcopy runs correctly called from cmd but not with double click

I'm testing a solution for a user getting access denied when running a scheduled backup batch script or by double-clicking it. I've noticed I have the same issue for a simple xcopy call. Specifically,...
user avatar
2 votes
2 answers
377 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)?
user avatar
  • 1,298
0 votes
1 answer
100 views

Receiving an Error when Copying file over

I have a script that i run against 1K systems. In the script I copy a file over to the systems' temp folder. 1 or 2 systems out of 1K systems return an error of "Invalid drive specification" when I ...
user avatar
-1 votes
2 answers
236 views

Properly expand copied file names using XCOPY

I've made a batch script that is set to copy all .cpp files from a location I have set. It can copy the files and retain the folder structure, but it isn't expanding the copied file names properly. I ...
user avatar
  • 1,193
1 vote
0 answers
857 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 ...
user avatar
  • 11
1 vote
1 answer
2k views

Xcopy jpg files from subfolders of "%~dp0" using wildcard

I have one folder on my desktop Test, and in this folder I have two folders, WorkingFolder\Bilder and Station 1. So the structure looks like this: Test\WorkingFolder\Bilder Test\Station 1 Within ...
user avatar
0 votes
0 answers
28 views

Taking backup of files using XCOPY

I have a file_list where the paths of the source files are saved. ex: file_list -c:\SAY\hello\world.txt -c:\SAY\hello\New\file.txt Using for loop i tried copying the files which are in the ...
user avatar
1 vote
1 answer
7k 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 ...
user avatar
0 votes
1 answer
1k views

Copy files from one folder to another using a pattern based on input file in Windows

I need some help using for and xcopy to move files from one folder to another based on an input text file. What I need help with is matching files based on a pattern. My input file looks like this: ...
user avatar
  • 1
0 votes
1 answer
2k 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 ...
user avatar
  • 817
1 vote
1 answer
2k 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 ...
user avatar
  • 551
1 vote
1 answer
3k 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 ...
user avatar
0 votes
1 answer
931 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 ...
user avatar
  • 1
0 votes
1 answer
8k views

Moving files to FTP in batch file and delete source files

I need to create batch script for copy files from PC to FTP server. After copy - delete all files from source. And in destination directory overwrite all existing files. I found many solutions, but I ...
user avatar
  • 13
0 votes
2 answers
451 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 ...
user avatar
0 votes
1 answer
4k views

Copy files with full relative path in Windows

I have a large set of files (45,000+) in a pretty complex folder structure. I extracted a subset of ~13,000 files and their paths (relative to the root folder) that I want to copy with the original ...
user avatar
  • 191
0 votes
0 answers
154 views

Xcopy a whole folder [with all in it] ...BUT, how do I make Xcopy create a different folder every time or ask to create a new or overwrite?

I explain. I have this short .bat file to copy a 'folder' with all contents and it does create the folder named Source_folder with all contents. When I re-run it, Xcopy obviously find that folder ...
user avatar
0 votes
0 answers
984 views

Accessing Remote Desktop and Copy file from Remote Desktop to Local System using xcopy?

I am using Windows OS and accessing Windows server through a remote desktop connection. I want to run a exe file on Remote Desktop and store the results in a .csv file. Now I want to copy that result ...
user avatar
0 votes
1 answer
216 views

Batch to move file into sub directories excluding parent directory

I have a *otf file that I would like to copy into all the sub directories of the parent folder. This is what I have attempted. for /R %%x in (.) do copy "file.otf" "%%x" This works for the most part ...
user avatar
0 votes
0 answers
424 views

XCopy error code doesnt tally

i have a xcpoy command which copying content in a folder to another directory via Windows Task Scheduler. However, recently we noticed there were not some events, the xcopy doesnt really copying / ...
user avatar
0 votes
1 answer
230 views

Copy calendars items without prefixing subject line with "Copy: "?

I'm trying to drag all items from a calendar in one PST file to a calendar in another. I am prompted to Choose between "Copy", "Copy Series", "Copy Occurrences". No matter what I choose, the subject ...
user avatar
  • 197
0 votes
1 answer
39 views

Attempt To Use Batch Files While Keep Structure

I wanted to use robocopy, but it is not possible due to my text file has filenames attached. I ended up have to use copy instead. I wanted to copy files like this... Source: S:\folder\A\B\C\D\E\...
user avatar
  • 3
2 votes
1 answer
409 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 ...
user avatar
0 votes
0 answers
280 views

Windows 10 xCopy Over Network

We have a Windows 10 box here that's been running a batch file that runs an xcopy on a folder with subfolders. It's been running happily for years, but last week, on 12th December, for no apparent ...
user avatar
0 votes
2 answers
86 views

Copy all files from all folders Windows CMD

I have this structure in Windows Server: PARENT DIRECTORY ├───DIRECTORY1 │ ├───FILEA │ └───FILEB ├───DIRECTORY2 │ ├───FILEC │ └───FILED └───DEST_DIRECTORY I want to copy only ...
user avatar
0 votes
1 answer
68 views

copying from subdirectories to one directory windows bat [closed]

I'd like to copy all files from subdirectories to one destination, using Windows bat. Example: Files to copy: C:\src\a\1.bmp C:\src\a\2.bmp C:\src\a\b\3.bmp Copied files: C:\dst\1.bmp C:\dst\2.bmp C:...
user avatar
1 vote
1 answer
552 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, ...
user avatar
  • 23