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 COMMANDS 1

Status
Not open for further replies.

tomomark

Technical User
May 23, 2003
109
GB
All,

How do i refer to C:\Documents and Settings inside a copy command

C:\> xcopy C:\Documents and Settings\test C:\backup

for example

mark
 
Mark,

Not sure if you are serious about this question, or just jerking our chains.....

If you are serious, I apologize. It's just that this hardly seems an appropriate question for the 'Windows 2000 Server' forum....although most of the folks here should be able to tell you the answer:

Just wrap whatever path you have that contains spaces in quotes, i.e.
c:> xcopy "C:\Documents and Settings\Test" c:\backup

No offense, I hope....

MM

Martijn Middelplaats
CCDA, CCNA, MCSA, MCSE
martijn at middelplaats dot net
 
martijn,

It's is a very "relevant" forum to ask such questions. As someone who has supported NT and 2K for years, I find that it is much faster to do certain things from the CL, like automating tasks in a batch file or running scripts. Also, most of the RK tools will only run from a CL.

No offense, I hope....

Ian
 
Ian,

None taken.

I disagree though. There's a whole section on Desktop Operating Systems (several forums on DOS-based OSs, even) where I think a question like this one would have been more in keeping with the topic.

Although I, too, still use the command line for a significant portion of my work, I don't classify those activities as specific to Windows 2000 Server. Much like I still use a lot of NT4 tools managing my Win2K environment, questions about which I would most likely direct at the NT4 forum.

As much as I think the appropriate and helpfull thing to do is to answer any question I can (which I did), I also think the responsibility is on each forum's users to try and keep the threads on topic (which I'm trying). Although I guess this post is as much off topic as Mark's initial question... [blush]

MM

Martijn Middelplaats
CCDA, CCNA, MCSA, MCSE
martijn at middelplaats dot net
 
Have to side with Maple on this one. Any topic that relates to Windows 2000 server has a place here. There are programs, tools and commands that have their origin in other places such as DOS, NT, 9x and linux, but act signifigantly different under 2000 (I.E. the AT command). The best way to get the Right answer is to ask the question in the forum for the environment that you are using it in. Eventhough it is a Dos command it was obviously being used on a 2000 (or xp), machine C:\Documents and Settings, and therefore posted in the correct place.


Electricity is actually made up of extremely tiny particles called electrons, that you cannot see with the naked eye unless you have been drinking.
Dave Barry
 
All,

the whole reason for posting this post was

i understand the command is 'xcopy Source Destination' however when i put C:\documents and settings it says cant find the file

cd if i do 'cd docuemnts and settins works a wonder...

why???
 
Put your source and destination in quotes.

Heh not to be an (_|_) but if he had asked about say...

xcopy /E /Y /H /O "C:\Winnt\Profiles\%Username%\" "X:\Profiles\%Username\"

Would you have jumped all over him?

The question was valid depending on your point of view. Jumping on someone for asking a command line question in a server forum doesn't make much sence. Who uses the command line options more than admins.
 
Sigh.

Reading posts before responding, does make sense, Dodger6.

But to answer your question: no I would not have 'jumped all over him', just as I didn't 'jump all over him' regarding the original post. Scroll back up, and you will notice that I prefaced my response with an apology, followed with an actual answer to the question, and closed saying no offense was intended. I can't speak for Mark (and I won't), but I seriously doubt he felt like he was being flamed.

I merely suggested there might have been a better place to post the question. It was just an opinion, just like the ones posted in response to mine.

And just for the record: I think Dave Barry made a valid point, about the question as well as about drinking. And I also think that your response provides a helpful perspective for me to look at this in a different way; it's fair to say that if the context of the question had hit closer to home for me, I would quite possibly not have raised the issue about it's legitimacy... So the point is well taken, trust me.

So, with thanks to everyone who enlightened me, and at the risk of spoiling anyone's fun: can we focus on the topic again?

[pipe]

MM



Martijn Middelplaats
CCDA, CCNA, MCSA, MCSE
martijn at middelplaats dot net
 
tomomark,

The quick answer is that the CL uses spaces to parse parameters, so the rule is enclose in "" anything that contains spaces. So the CL sees :-

xcopy c:\documents and settings\...

as

xcopy 'c:\documents' 'and' 'settings\...'

and

xcopy "c:\documents and settings\..."

as

xcopy 'c:\documents and settings\...'

If you want to explore more of the Windows CL, I'd recommend the following:-

Windows NT Shell Scripting by Tim Hill

Ian
 
Tomomark,

And to answer your question about why the CD command doesn't behave the same way: CD (or CHDIR) doesn't treat spaces as delimiters, which explains why you can use

c:\>CD Documents and Settings

without any problem.

MM

Martijn Middelplaats
CCDA, CCNA, MCSA, MCSE
martijn at middelplaats dot net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top