1.

Solve : Xcopy command Invalid parameter?

Answer»

Hi,
I'm new at USING DOS and doing Xcopy.

at the c:\> prompt I typed

xcopy /s/y "C:\documents and settings" "D:\documents and settings"

The response I get is
Invald paramreter
-"C:\documents

Thanks for the help.helpAt the command prompt.
First, make sure both directors exist.
Log onto the D: drive and CD to the directory
Go back to C: and CD to the directory

XCOPY /s /y C: D:

Does that help any?


Quote from: ubcome on February 05, 2009, 08:49:42 PM

Hi,
I'm new at using DOS and doing Xcopy.

at the c:\> prompt I typed

xcopy /s/y "C:\documents and settings" "D:\documents and settings"

The response I get is
Invald paramreter
-"C:\documents

Thanks for the help.
In Xcopy, the switches go at the end of the command line, like this:

Xcopy "C:\junk\*.*" "D:\junk\" /s /y

That line will copy everything in the junk folder in C: to a junk folder in drive D:.
You MUST first make the "junk" folder on D: for this to work properly.

Does that make sense?

Every day, I back up my entire "My Documents" folder (and several others) to a like folder on drive D:

The way I have it written, the first time I ran the batch file, it backed up the entire directory, but the next time I ran it, it backed up only new files and files that had been updated or changed.
Now I run it in my shutdown batch file and it backs up just a few files and takes only a few SECONDS to run.

Here's the text of that shutdown batch file:

@ECHO off
cls
xcopy "C:\Documents and Settings\Alex\My Documents\*.*" "D:\My Documents\" /s /y /H /R /D

Rem Back up my WordPerfect files.
xcopy "C:\MyFiles\*.*" "D:\MyFiles\" /s /y /H /R /D

Rem Back up all the files for My Web Page.
xcopy "C:\My web page\*.*" "D:\My web page\" /s /y /H /R /D

Rem Back up my email folders and address book.
xcopy "C:\Documents and Settings\Alex\Local Settings\Application Data\Identities\{CC1A6FC7-0D07-4169-865D-56EBDD76EB8B}\Microsoft\Outlook Express\*.dbx" "D:\MyEmailFiles-Backup\" /s /y /H /R /D
xcopy "C:\Documents and Settings\Alex\My Documents\My Address Books\*.*" "D:\My Address Books" /s /y /H /R /D

Rem When the backup is done...Shutdown!

%windir%\System32\shutdown.exe -s -t 00 -f

In your example, you will be copying all the files in those folders, over and over again.
That's pointless and very time consuming.
I suggest that you add more switches like I've done, to copy only new or changed files.

Just a suggestion,
Shadow That's good stuff, Shadow.

You might want to make a menu to select what kind of backup
you want. All of my documents, only new and changed, or other options.

Thanks.


Discussion

No Comment Found