Share via

Simple batch file gets syntax error

Anonymous
2024-10-06T01:43:01+00:00

My one-line batch file gets the error message :The syntax of the command is incorrect. I'm pretty sure this is not so.

As in so many many other cases, Microsoft gives a generic error message that has no apparent connection to what the user is trying to do. As a result, we don't know what is going on, and we don't know what to do. So we have to waste the time of a Microsoft representative, and maybe get an answer in a couple of years.

And it's even longer for a CORRECT answer.

Here's my batch file:

@echo off<br><br>copy C:\Users\larry\OneDrive\Pictures\user.png C:\ProgramData\Microsoft\User Account Pictures

Okay, it's two lines.

What I'm trying to do is copy a revised (blank) png file to where it needs to go to appear on the sign-in page.

My guess is that I'm trying to copy to a protected folder. If so, why doesn't Windows tell me that?

I don't see a syntax error.

I'll eventually figure it out, don't worry.

[Naturally, not one of the Topics is remotely appropriate for this question. I'll pick at random, OK?]

Windows for home | Windows 11 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. _AW_ 67,206 Reputation points Volunteer Moderator
    2024-10-06T01:45:05+00:00

    The second file path contains spaces so it needs to be quoted.

    copy C:\Users\larry\OneDrive\Pictures\user.png "C:\ProgramData\Microsoft\User Account Pictures"

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful