Archived

This topic is now archived and is closed to further replies.

backing up with batch files

This topic is 5650 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, I don''t even know if this would be the appropriate place to posat this, but here it goes (since I''m having a hard time getting answers on the net) Anyhow, I''m trying to write a simple batch file to backup certain files from my c: drive to my d: drive or f: drive (which has a writable CD rom in it).. anyways, I wrote the follwoing code, however I keep getting the error message "invalid number of parameters"...I dont get it. All the places I go to list the format for using xcopy (which I believe I am doing) and yet still I keep getting the invalid parameters error... I''m using windows xp and here''s the line that im using... xcopy c:\Documents and Settings\fred\My Documents\*.* d:\backup_test /y /e /s ~bolt

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Perhaps this would work:

xcopy "c:\Documents and Settings\fred\My Documents\*.*" d:\backup_test /y /e /s

Share this post


Link to post
Share on other sites
quote:
Original post by LessBread
This may not be it, but if you're using /e then why also /s ?


Older version of XCOPY /e do not really includes /s as well.

[edited by - DerekSaw on June 25, 2002 10:18:07 PM]

Share this post


Link to post
Share on other sites
Add the quotes around your long directory names like AP suggested.

I think that xcopy is getting confused when it sees the spaces in a name like Documents and Settings. Unless you tell xcopy that the whole path (including spaces) is just one parameter by enclosing the whole thing between double-quotes, then xcopy will try to interpret it as many different parameters that make no sense.

Window''s long file and directory names cause all sorts of problems like that when you''re trying to do some old-school DOS batch file code.

--Roderick Smith

Share this post


Link to post
Share on other sites
quote:
Original post by DerekSaw
Older version of XCOPY /e do not really includes /s as well.


True, but since he''s running XP that isn''t likely to pose a problem.


Share this post


Link to post
Share on other sites