Bill Dawson
Bill Dawson

Reputation: 3

2 xcopy commands...one works, the other fails

I have 2 xcopy commands that are virtually identical in that they both contain the same number of paramenters. Only the paths are different. Yet one works and the other fails and produces "Invalid number of parameters". Here's the one that works:

xcopy /S /I /R /Y C:\Users\User\Desktop\Start_Menu_Backup\Database %LOCALAPPDATA%\TileDataLayer\Database

Here's the one that fails:

xcopy /S /I /R /Y C:\Users\User\Desktop\Start_Menu_Backup\icons %APPDATA%\Microsoft\Windows\Start Menu\Programs

Any help would greatly appreciated.

Upvotes: 0

Views: 49

Answers (1)

Fahad Sadah
Fahad Sadah

Reputation: 2418

When one of the directories contains a space, you need to enclose it in quote marks:

xcopy /S /I /R /Y C:\Users\User\Desktop\Start_Menu_Backup\icons "%APPDATA%\Microsoft\Windows\Start Menu\Programs"

Upvotes: 1

Related Questions