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

xcopy command error 1

Status
Not open for further replies.

gatetec

MIS
Mar 22, 2007
420
US
I am getting "Invalid number of parameters" from the xcopy command. Please advise what is wrong. thx much

C:\>xcopy C:\Documents and Settings\ADMIN\My Documents\* S:\PC2\ /D /E /C /R /H
/I /K /Y
Invalid number of parameters

C:\>xcopy C:\Documents and Settings\ADMIN\My Documents\* S:\PC2\ /D /E /C /R
Invalid number of parameters

C:\>xcopy C:\Documents and Settings\ADMIN\My Documents\* S:\PC2\ /D
Invalid number of parameters

C:\>xcopy C:\Documents and Settings\ADMIN\My Documents\ S:\PC2\ /D /E /C /R /H /
I /K /Y
Invalid number of parameters

xcopy C:\Documents and Settings\ADMIN\My Documents\* S:\PC2\ /D /E /C /R /H /I /K /Y
 
You have spaces in your path. DOS doesn't like spaces.

In other words your source parameter actually ends at: C:\Documents

And your destination parameter starts and ends at: "and"

However you still have more text afterwards and have a full path still S:\PS2

That drives it crazy.

You'll have to use the dos compliant names for your path such as:

C:\Docume~1\ADMIN\Mydocu~1\

for exact names type "dir \x" to get the Valid DOS names for the directories.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Or enclose the path in quotes:

Code:
xcopy "C:\Documents and Settings\ADMIN\My Documents\" S:\PC2\ /D /E /C /R /H /I /K /Y
 
I created "xcopy.cmd" (script below) and executed, but none of files and directories are being copied.

xcopy "C:\Documents and Settings\ADMIN\My Documents\*" S:\PC2\ /D /E /C /R /H /I /K /Y
::end batch


In the prompt, the command, "xcopy "C:\Documents and Settings\ADMIN\My Documents\*" S:\PC2\ /D /E /C /R /H /I /K /Y" is scrolling fast, but no files and directories are shown on S:\PC2\

pls advise.
 
You have created a CMD file that is calling itself over and over and over and ...

Rename the CMD file to something else, e.g. myxcopy.cmd and it should work. And it is not good practice to name BAT or CMD file the same as a valid command.
 
Hi. James here. is there anyone can help me with xcopy command in DOS Batch File. Actually, i can successfully copy files from one drive to another drive..

My command is here

xcopy c:\test d:\test /e /i /y /d


My question now is, is there a way that i can have a log file that will give me informations that the files were copied with date and time specified?

i have tested

xcopy c:\test d:\test /e /i /y /d > log.txt

but it only gives me that the files were copied and no specified date and time.

your help is very much appreciated.

-james
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top