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
4
votes
2 answers

Why does Hudson not recognize xcopy as a command?

I have a windows batch command in my hudson build step that is basically: xcopy /s *.* \\serverlocation\buildname\ The copy is failing with: 'xcopy' is not recognized as an internal or external command, operable program or batch file. However,…
mmr
  • 14,781
  • 29
  • 95
  • 145
4
votes
4 answers

Batch script to make backup folder. only new and modified files

I need a script to copy only the changed/modified and new files from my C:\Dropbox to my C:\backup. Why does this copy only the folder structure: @echo off set destination=C:\Backup set source=C:\Users\XXXX\Dropbox\Intranet for /F "tokens=2-4…
ilansch
  • 4,784
  • 7
  • 47
  • 96
4
votes
5 answers

Why does Windows XCOPY fail when invoked via Perl system call via psexec?

I'm using psexec to launch a Perl program on remote Windows machines. The program makes a system call to xcopy.This works fine when run directly (locally) on the machines, but when run remotely via psexec, the xcopy fails with the following…
UhClem
  • 129
  • 3
  • 10
4
votes
2 answers

Powershell: 'The fully qualified file name must be less than 260 characters'

I tried to use powershell command copy-item as xcopyto copy content of one disk to another one. copy-item -Path h:\* -Destination g:\ -Recurse -Force However, I encountered the following errors: Copy-Item : The specified path, file name, or both…
Loom
  • 9,768
  • 22
  • 60
  • 112
3
votes
2 answers

How to exclude a specific file from being copied using xcopy

I'm new to Windows batch files, but I'm writing a .bat file that just copies a bunch of files from one place to another maintaining the file directory structure. Using xcopy this is simple but I need to exclude some files from being copied. You can…
Bill Walton
  • 811
  • 1
  • 16
  • 31
3
votes
3 answers

How to show output of xcopy in powershell script while it's running

I have this powershell scrip where I want to copy files from our production server to our test server, and only have it copy files which are newer or changed. The script itself has many more functions but this copying is one of those. I'm using the…
SuperDre
  • 157
  • 10
3
votes
0 answers

How to make XCOPY in Visual Studio Post Build Event Command Line support both Linux and Windows?

How to make XCOPY in Visual Studio Post Build Event Command Line support both Linux and Windows? I have a post build event command line in my C# project and can works well on windows, but always failed when build in GitHub CI action, due to GitHub…
3
votes
1 answer

Getting notification from xcopy if file copy

I am generating a Windows Batch script to copy a file, only when the source is updated. If the file is updated, I want to delete another file. The problem is that I can't find a simple way to trigger an event when the file update happens. I thought…
EcksMedia
  • 461
  • 2
  • 5
  • 20
3
votes
1 answer

Windows context menu run hidden xcopy

I am trying to add a new option to the context menu for folders in Windows. I have managed to add the option and specify its command as follows: xcopy.exe "%0\*" "c:\Destination\" /EHY This code is added to regedit.exe I have a folder in the c:…
Hi Bee
  • 31
  • 4
3
votes
4 answers

Is it possible to "launch" a copy of a (large) file without waiting for the result?

I think it's pretty obvious in the title ; I want to copy a file without waiting for the result. Functionaly I want this : static void Main(string[] args) { string strCmdText = @"/C xcopy c:\users\florian\desktop\mytestfile.fil…
Florian
  • 4,507
  • 10
  • 53
  • 73
3
votes
2 answers

Copying multiple files by *.extension with xcopy

I'm making a batch script to copy all .doc, .pdf, .xls etc from disk to a pendrive. My current code below: @echo off Title "" ::All Docs XCOPY C:\*.doc W:\xdatabase /C /S /I /F /H > W:\database\XC\AllInf.txt ::All PDFs XCOPY C:\*.pdf…
Derley mad
  • 63
  • 1
  • 6
3
votes
1 answer

Visual Studio Post-Build xcopy dont work: error MSB3073: :"VCEnd" exited with code 4

I have following post build command: XCOPY "$(SolutionDir)*" "D:\VS\Win1\*" /EXCLUDE:"E:\exclude.txt" /Y /E /D When building I get these message: 1>------ Build started: Project: Win1, Configuration: Debug Win32 ------ 1> Can't read file:…
NoName
  • 7,940
  • 13
  • 56
  • 108
3
votes
0 answers

Visual Studio Post Build "xcopy exited with error -1073740791"

My project does an xcopy of some files in the pre build using the command below xcopy /y "$(ProjectDir)\Library*" "$(SolutionDir)\TAOutputDLLSet\" Its been working without any issue till today when suddenly it returns the following error The…
Caulibeam
  • 151
  • 2
  • 11
3
votes
1 answer

Backing up specific files before replacing them based on source folder contents in batch

I am a novice but trying to create a batch file that reads the folder contents of the source, compares the files to the destination, backs up the matches, and then moves the source files to the destination. I guess in a way the file contents in the…
Sid
  • 107
  • 4
3
votes
1 answer

Copy all txt files from all subfolders using xcopy

I have been tasked with copying all .txt files from the Program Files folder as well as all of it's subdirectories to another folder I have created. The script I have: xcopy c:\"program files"\*\*.txt c:\temp\myfiles\lessons doesn't want to work.…
ownificate
  • 63
  • 1
  • 1
  • 5