Kentc's SOAPbox

Disclaimer: All opinions are solely mine and don't necessarily reflect the opinions of Microsoft or my family.

When did DOS get so complicated?

Admittedly I haven’t used MS-DOS in quite a while and sadly even after all of the cool advances in Windows I find myself still needing it.  For example I have to batch scripts I started to work on today.  The first one is supposed to copy all of our digital photographs to all of our other computers.  That is so that using the My Pictures screen saver lets us see all of the photographs we’ve taken over the past five plus years.  The second one is simply supposed to copy all of our files from one PC to another PC.  Using the xcopy /?  I thought that

XCOPY C:\Documents and Settings\All Users\Documents\My Pictures\*.* \\dell333\Backup\DellP4\All Users\Documents\My Pictures\*.* /D /E /C  

would copy all of our pictures from the shared My Pictures directory to a PC named Dell333’s shared My Pictures directory.  When run it would (OK should) skip all of those files with the same date and time stamp (/D without addt’l parameters), copy the even those directories who were empty (/E), and continue copying even if an error occurs (/C). Instead I get an “Invalid number of parameters” error.

I think I understand why Unix SysAdmins (who are incredibly adept with scripts) don’t like Windows.  Any one have any ideas?

Published Saturday, January 17, 2004 6:50 PM by Kentc

Comments

 

Jeff Almasol said:

Did you try enclosing the source and destination paths in quotes?
January 17, 2004 5:01 PM
 

Kirk Marple said:

You need to put the cmd-line parameters before the directories. Also, you do need to put the directories within quotes if they contain whitespace. I think you don't need the *.* either.

XCOPY /D /E /C "C:\Documents and Settings\All Users\Documents\My Pictures\" "\\dell333\Backup\DellP4\All Users\Documents\My Pictures\"

You could also create file shares pointing to those directories to make them easier to remember.

XCOPY /D /E /C "\\localhost\My Pictures\" "\\dell333\My Pictures\"

January 17, 2004 5:12 PM
 

Kent said:

Ah, the quotes. Can you tell the last time I did DOS commands was prior to Windows 95 and long file names? <g> Thank you Jeff and Kirk!! That did it. For my own sake, I wish we (MSFT) had more descript error messages.

Kent
January 17, 2004 5:17 PM
 

Raymond Chen said:

What error message would you have preferred? "Too many parameters on command line"?
January 17, 2004 5:22 PM
 

Shannon J Hager said:

The problem is probably due to the space in "my pictures". You probably need to use "mypict~1" instead. Also do the same for "all users", and "documents and settings": "alluse~1" and "docume~1", respectively.
January 17, 2004 5:29 PM
 

Ian Griffiths said:

Of course this isn't really DOS. When you fire up a command line in Windows XP (or Windows 2000, or Windows NT for that matter), then you're not usually using DOS. You're using the Windows command line.

If you want DOS you must launch it with COMMAND.COM. Try typing COMMAND at a command prompt and it'll drop you into DOS mode. And you'll soon find that it's not at all the same as using the Windows command line. (No command line completion, no support for long file names, everything runs really slowly...)

Not only is the quality of user experience at the command line much better than it was in DOS, there are a whole lot more commands than DOS used to have.

So it's no more DOS than running a Unix command line on Windows (which you can do - there are various ports) is DOS. It's a command line, and it happens to support a lot of the old DOS commands but it's not the same thing.
January 17, 2004 5:46 PM
 

Kirk Marple said:

I think the one thing that would be more useful would be extra examples in the "xcopy /?" help text. That way you could see the proper usage for common (or not-so-common) tasks.
January 17, 2004 6:32 PM
 

Brian Desmond said:

How about just usign robocopy from the res kit (available since NT4)

There'sa full word doc help manual, or you can just use this command:

robocopy "C:\path\to\your\source\my pictures" \\sometarget\somepics /mir

Keep in mind that the /mir switch will do a true mirror of the source - it will delete files in the destination that don't exist in the source. If you don't want this:

robocopy "C:\path\to\your\source\my pictures" \\sometarget\somepics /e /eta /v /z /r:0 /w:0 /log:c:\mypics.log

You actually only need the /e, but I tag on the rest to diagnose why a copy might fail, and also to be able to restart the failed copy where it left off (/z does that).
January 17, 2004 6:53 PM
 

RoudyBob said:

January 17, 2004 7:07 PM
 

RoudyBob.NET said:

January 17, 2004 8:12 PM
 

Doug Thews said:

Hey, you could always go back to the 8.3 filenames and get something like:

XCOPY c:\DOCUME~1\ALL~1\DOCUME~1\MY~1\*.* \\dell333\Backup\DellP4\ALL~1\DOCUME~1\MY~1\ /D /E /C
January 17, 2004 10:41 PM
 

jdzions said:

Why not install Services For Unix and do it the Unix way? Of course, you have to enclose paths-with-embedded-spaces in quotes in Unix, too, and the error messages are just as cryptic, but... :-)
January 17, 2004 11:18 PM
 

Vijay said:

hmm i guess everyone comes to this realization once in a while ! my problems were similar but not only wrt copying stuff ..

http://dotnetjunkies.com/weblog/unknownreference/posts/5676.aspx

there is still lots of functionality that MS could add to the CMD shell inorder to make it a convenient ambience for those who are comfortable with CMD ! What do you think ?
January 18, 2004 7:46 AM
 

billb said:

robocopy is the way to go, it is what I use to mirror my home network across several machines.
January 19, 2004 12:22 PM
 

Kentc's SOAPbox said:

January 24, 2004 11:42 AM
 

Kentc's SOAPbox said:

January 24, 2004 11:44 AM
 

RoudyBob.NET said:

February 14, 2004 12:31 PM
 

Deva said:

where can I find a list of the variable parameters to use with "copy"? I used to do copy of very large files within a program, by placing a variable to validate the copying of each file by choice, y or n. Would appreciate any list or suggestions you could point me to. Thanks for your time!
February 15, 2004 8:01 AM
 

Kent said:

I typically use the /? behind the command to see its actions. You might try searching on Microsoft.com because I have seen a TechNet article that describes each of them in great detail.

Kent
February 15, 2004 9:52 AM
 

Bennor said:

Why do these folks keep posting, you already resolved your issue :)
May 11, 2004 3:52 PM
 

HTR said:

How may tell to ROBOCOPY how should be logged in a UNIX server?
June 18, 2004 6:22 PM
 

robocopy cmd window error 53 said:

July 11, 2008 5:13 AM
 

Kentc s SOAPbox When did DOS get so complicated | debt consolidator said:

June 19, 2009 10:31 AM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker