Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

to xcopy or not to xcopy

Original Message
Name: akhen
Date: March 19, 2007 at 11:09:26 Pacific
Subject: to xcopy or not to xcopy
OS: DOS
CPU/Ram: 1024
Model/Manufacturer: IBM
Comment:
I am trying to copy 1 file from one directory, to a directory's subdirectories. I'm trying to use xcopy to do it like so:

xcopy "C:\source directory\file.txt" D:\destination\dir\ /s

It's only copying to D:\destination\dir but not all the subdirectories in dir.

Any idea why?

technoguy


Report Offensive Message For Removal


Response Number 1
Name: Mechanix2Go
Date: March 19, 2007 at 12:00:12 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
"C:\source directory\file.txt"

is not a valid path/filename in DOS, so let's assume you're using NT.

::== axx.bat
@echo off
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in ('dir /b/s/ad D:\destination\dir') do (
copy "C:\source directory\file.txt" "%%a"
)
::==


=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal

Response Number 2
Name: akhen
Date: March 19, 2007 at 12:47:13 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
You guys are insane here at Computing.net. How did you come up with that M2? Amazing. Thank you!

technoguy


Report Offensive Follow Up For Removal

Response Number 3
Name: Mechanix2Go
Date: March 19, 2007 at 14:28:07 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
It's the insanity effect.


=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal

Response Number 4
Name: orbital
Date: March 20, 2007 at 08:49:01 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
This is NT COMMAND PROMPT and NOT MS-DOS COMMAND LINE

Report Offensive Follow Up For Removal

Response Number 5
Name: akhen
Date: March 20, 2007 at 13:43:01 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
Orbital, your response was ever so helpful.

technoguy


Report Offensive Follow Up For Removal


Response Number 6
Name: orbital
Date: March 20, 2007 at 15:06:18 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
Well akhen you can now post future questions in the appropriate forum !!

Report Offensive Follow Up For Removal

Response Number 7
Name: akhen
Date: March 20, 2007 at 15:40:40 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
I would not have expected an NT person to know the proper DOS commands, albeit, it's not "DOS" but rather a DOS emulator, but I figure it was close enough. Your comments are just nit-picky.

Maybe instead, you could tell me that Xcopy won't work, and instead use ... or something like that, instead of nitpicking. I knew what I was doing when I wrote: "C:\source directory\file.txt" By using the quotes, I gave that clue that I was using Windows, and not just DOS, but if I had put instead: C:\sourcedir\file.txt I would not be getting the commentary.

technoguy


Report Offensive Follow Up For Removal

Response Number 8
Name: orbital
Date: March 20, 2007 at 17:00:23 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
Oh! yes you would............

Report Offensive Follow Up For Removal

Response Number 9
Name: jboy
Date: March 20, 2007 at 18:51:02 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
Instead of leaving 'clues', lying about your OS (the ever unlikely "DOS") and making assumptions about just what "an NT person" would know - try being straightforward from the beginning

-- and yeah, the right forum helps too (you charmer you)


I'm not one of those who think Bill Gates is the devil. I simply suspect that if Microsoft ever met up with the devil, it wouldn't need an interpreter.


Report Offensive Follow Up For Removal

Response Number 10
Name: akhen
Date: March 21, 2007 at 06:28:32 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
Who's lying about the OS I use? This is rediculous. I've already got my answer. Move on.

technoguy


Report Offensive Follow Up For Removal

Response Number 11
Name: orbital
Date: March 21, 2007 at 06:36:40 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
All we ask is that you post in the correct forum, period!! Is that too much to ask ??

Report Offensive Follow Up For Removal

Response Number 12
Name: Mike Newcomb
Date: March 24, 2007 at 02:26:20 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
Ahkhen - I think to do what you want you should use the COPY command.

XCOPY came about to fill a gap or gaps not covered by COPY. e.g. copying of subdirectories, empty or otherwise.

However XCOPY should do what you require, I suspect you are not using the parameters correctly.

Copy (and maybe xcopy) should work with something like this:-

COPY C:\dir\sdir\file.ext
D:\dir\sdir\ /v

Good luck - Keep us posted.


Report Offensive Follow Up For Removal

Response Number 13
Name: Mechanix2Go
Date: March 24, 2007 at 03:00:10 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
read #1 & #2


=====================================
If at first you don't succeed, you're about average.

M2



Report Offensive Follow Up For Removal

Response Number 14
Name: Mike Newcomb
Date: March 26, 2007 at 19:25:03 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
Dear Mechanix

From #1, I do not agree with

"C:\source directory\file.txt"
is not a valid path/filename in DOS,

Ahkhen advise he is trying to copy just one file, therefore COPY should do this.

He appears to have included 'destination' and /s in his XCOPY parameters, which if so is incorrect.

Regards - Mike

Good Luck - Keep us posted.


Report Offensive Follow Up For Removal

Response Number 15
Name: orbital
Date: March 27, 2007 at 01:05:20 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
IRRELLEVENT as this is a NT COMMAND PROMPT discussion, nothing to do with MS-DOS Command Line!

Report Offensive Follow Up For Removal

Response Number 16
Name: emuarcade
Date: April 17, 2007 at 20:12:01 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
You may want to try XXcopy16.
its like Xcopy but with more switches.
cons: It seems to lockup with .dat files
It may be the switch I use.
xxcopy c:\folder c:\backup /e /h


Xfactor


Report Offensive Follow Up For Removal

Response Number 17
Name: akhen
Date: April 18, 2007 at 06:00:16 Pacific
Subject: to xcopy or not to xcopy
Reply: (edit)
Thanks for replying to this post after so long. Mechanix did answer my post (albeit, his answer was for a superscripter, and I am an infant scripter). I like your answer because it looks simple. Thanks again!

technoguy


Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: to xcopy or not to xcopy

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




how to setup call of duty to joytok

WindowsME / HotMail Problem

Corrupt memory

Convert fat32 to Ntfs

Best WinMo phone of 2008


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC