Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xcpoy call *.doc in a hard drive not working 1

Status
Not open for further replies.

jsundin3

Technical User
Oct 2, 2001
60
US
Heres the simple batch
===============
xcopy.exe g:\*.doc g:\temp\4test\12 /W /I /F /V
REM copies and verifies all docs
pause
=================

Yes it does copy .doc's, but only from the root directory (G:*.doc), but will not copy from folders and subfolders inside G:

Any ideas? JeffS
 
You need to add the following switches at the end of the first line:

/S /E

[tab]* this will instruct it to search in subdirectories *


To view a list of available switches, type xcopy /? at a command prompt.


~cdogg

"The secret to creativity is knowing how to hide your sources."
- A. Einstein
 
Try using the "/S" switch for xcopy.

xcopy.exe g:\*.doc /S g:\temp\4test\12 /W /I /F /V


mot98
[cheers]

"Victory goes to the player who makes the next-to-last mistake."
- Chessmaster Savielly Grigorievitch Tartakower (1887-1956)
 
I believe all the switches must be at the end of the command line, not in the middle. Re-write it like this:

xcopy g:\*.doc g:\temp\4test\12 /W /I /F /V /S /E


~cdogg

"The secret to creativity is knowing how to hide your sources."
- A. Einstein
 
Thanks for your reply, I didn't think of the /S cause it was for copying........I will give it a try! JeffS
 
nope did not work "Cyclic error", i dont need folders, just wanted all *.doc files in folders and subfolders in G:

Any ideas? JeffS
 
xcopy g:\*.doc g:\temp\4test\12 /s seems to work for me, you get all the .doc files from g: and all the .doc files from every subdirectory in its own subdirectory.

Is that what you want?

HTH

LeBodge.

"I know what I like and I like what I know"
 
Part of the problem is probably that one of your subdirectories, g:\temp\4test\12 is also the destination. So when you use the /S switch, it's going to try to copy .DOC files that it finds in that directory to the same location.

Instead, move your destination location off the G:\ drive if possible. Otherwise, you probably aren't going to be able to use that switch.


~cdogg

"The secret to creativity is knowing how to hide your sources."
- A. Einstein
 
yeah I was testing the script there, ok that makes sense. And that is why I gave you a star before lol, thank you....... JeffS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top