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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOS bat file

Status
Not open for further replies.

Mbroad

Programmer
Feb 26, 2004
49
US
Hi-Not sure if this is correct forum or not, but here goes.
I am trying to create a bat file that will copy a file from my pc to a network drive. Easy enough--except that the directory names on the network drive contain many spaces and the copy does not like that. (using xcopy).

Something like
XCOPY CC-ABSTRACT S:\Team Folder\Working Documents\

returns with an error of "too may parameters" and does not execute the copy.

Any help would be much appreciated.

thanks a lot.
MB

Government Coder Mark
 
If there are spaces, but the line in quotes.
And if you are just copying a file, you don't have to use XCOPY, just COPY.

COPY CC-ABSTRACT "S:\Team Folder\Working Documents
 
Add a /Y parameter to the copy if you just want it to copy without prompting whether the file exists or not.
 
Try using an 8.3 command like

Copy cc-abstract s:\teamfo~1\workin~1

If you are unsure of the 8.3 name use dir /x and it will tell you

How I miss dear old DOS

TTFN,

TC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top