Computing.Net > Forums > Programming > Xcopy command is not working

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Xcopy command is not working

Reply to Message Icon

Name: VasimRaja
Date: February 7, 2009 at 12:26:55 Pacific
OS: Windows Vista
CPU/Ram: Intel (R) Core(TM) 2 Duo CPU and 2038MB
Product: Dell / INSPIRON 1525
Subcategory: General
Comment:

As you answered for this topic "Copy files from mult. subfolders" , xcopy command is not working for me.

Actually I want to copy files from multiple subfolders (under the same parent folder) to another directory using DOS commands? For example, if I wanted to copy all files named *test* (any file type) located in folders C:\A\1\, C:\A\2\, C:\A\3\ and paste them in C:\B\, is that possible?

I have tried the below command without success.Could you please help me to solve this issue

C:\> C:\A\*.\*test* C:\B

With Regards
VasimRaja.R



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: February 7, 2009 at 17:53:18 Pacific
Reply:

Untested:

FOR /D /R "C:\A" %%a IN (*) DO COPY "%%~Fa\*test*" "C:\B"


0

Response Number 2
Name: VasimRaja
Date: February 8, 2009 at 08:20:15 Pacific
Reply:

I am very soory.

getting this error...
"%%a was unexpected at this time."

Is there any way to fix this.

Regards
VasimRaja.R


0

Response Number 3
Name: Razor2.3
Date: February 8, 2009 at 15:07:43 Pacific
Reply:

That has to be stuck in a Command Script, it can't be typed in to the command line raw.


0

Response Number 4
Name: VasimRaja
Date: February 10, 2009 at 11:09:04 Pacific
Reply:

I am not using any scripting languages,I want to execute the commands in command line (a black window) itself.I have tried xcopy command as follows

1. C:\> xcopy C:\A\*.\*test* C:\B

It is not working.I am getting this error
"File not found - *test*
0 File(s) copied "

But actually files are available in the subdirectories.


2. C:\> xcopy C:\A\*test* C:\B /S

This command copies all the files with the subdirectories i.e subdirectories are created while copying.I want to copy the files only.

Please get me out from this issue.


Regards
VasimRaja.R


0

Response Number 5
Name: Razor2.3
Date: February 10, 2009 at 15:47:11 Pacific
Reply:

I want to execute the commands in command line (a black window) itself.
Still untested:

FOR /D /R "C:\A" %a IN (*) DO COPY "%~Fa\*test*" "C:\B"


0

Related Posts

See More



Response Number 6
Name: VasimRaja
Date: February 13, 2009 at 10:51:52 Pacific
Reply:

Thanks for your reply,Please let me know once it is tested.


Regards
VasimRaja.R


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Xcopy command is not working

FC command does NOT work in a batch www.computing.net/answers/programming/fc-command-does-not-work-in-a-batch/17859.html

C++ 3.0 is not working over XP OS www.computing.net/answers/programming/c-30-is-not-working-over-xp-os/13290.html

complex xcopy n password batchfile www.computing.net/answers/programming/complex-xcopy-n-password-batchfile/16758.html