xcopy error: Invalid number of parameters

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
tobwz
Posts: 30
Joined: 25 Feb 2022 03:21

xcopy error: Invalid number of parameters

#1 Post by tobwz » 14 Apr 2022 23:21

I opened Command Prompt and entered the following command:

Code: Select all

xcopy "%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" "test" /E /C /H /R /K /Y
and got the following answer:

Invalid number of parameters

The path to %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar exists

Whats wrong?

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: xcopy error: Invalid number of parameters

#2 Post by aGerman » 16 Apr 2022 14:14

Works for me as is.

Steffen

Puccilillo
Posts: 8
Joined: 11 Apr 2022 09:33
Location: Italy
Contact:

Re: xcopy error: Invalid number of parameters

#3 Post by Puccilillo » 17 Apr 2022 06:29

I got questioned if "test" had to be a file or a directory.
But it worked indeed.

I use Windows 10

Puccilillo

tobwz
Posts: 30
Joined: 25 Feb 2022 03:21

Re: xcopy error: Invalid number of parameters

#4 Post by tobwz » 17 Apr 2022 09:14

Thank you for comments.

Today I tried to execute the command again.....and it worked.

Very strange.
I have absolute no clue what the reason was.
A missing reboot cannot be the reason. I tried that trick already a couple of does ago.

So ok problem is solved anyway

tobwz
Posts: 30
Joined: 25 Feb 2022 03:21

Re: xcopy error: Invalid number of parameters

#5 Post by tobwz » 18 Apr 2022 02:07

I have to revert to this question.

meanwhile I found the problem:

Code: Select all

"%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"
Is a System directory.

And Xcopy cannot copy from (this) system directories

When I use xcopy with a normal user directory as source then everything works.
But Command Prompt in general rejects to work with system directories.

Try this basic command:

Code: Select all

cd /d “%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar”
It fails too

Any chance to bypass this restriction?

Puccilillo
Posts: 8
Joined: 11 Apr 2022 09:33
Location: Italy
Contact:

Re: xcopy error: Invalid number of parameters

#6 Post by Puccilillo » 18 Apr 2022 08:58

Still, both working for me.
What Windows version are you on? Do you have admin rights?

Post Reply