The term 'C:\Windows\System32>azcopy.exe' is not recognized as the name of a cmdlet, function, script file, or operable program

Justin Doh 920 Reputation points
2025-12-15T20:02:20.4233333+00:00

I am getting following error when I tried bottom Powershell script like below:

Script:

C:\Windows\System32>azcopy.exe sync "C:\AzCopyTest" "https://xxx.blob.core.windows.net/azcopy?sp=r&st=2025-12-15T19:29:44Z&se=2025-12-18T03:44:44Z&spr=https&sv=2024-11-04&sr=c&sig=xxxx" --delete-destination=true

Error message: The term 'C\Windows\System32>azcopy.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, of if a path was included, verify that the path is correct and try again.

User's image

This script (very similar) worked last time, but I am not sure what is going on this time.

Any suggestion?

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
{count} votes

Answer accepted by question author
  1. Ravi Varma Mudduluru 4,090 Reputation points Microsoft External Staff Moderator
    2025-12-15T20:40:01.03+00:00

    Hello @ Justin Doh,
    Thanks for reaching out to Microsoft Q&A

    Based on the error message you shared in the private message, I see two issues:

    1. Command formatting issue The command syntax is currently invalid. Please ensure the AzCopy command is formatted correctly, for example: Invalid: PS C:\Windows\System32> azcopy.exe sync "C:\AzCopyTest\TestData\Test" " --delete-destination=true Valid:
         PS C:\Windows\System32\azcopy.exe sync "C:\AzCopyTest\TestData\Test" " --delete-destination=true
      
    2. Insufficient SAS permissions The SAS token used does not have sufficient permissions to perform the sync operation. Since the command includes --delete-destination=true, the SAS token must include Read, Write, List, and Delete permissions (rlwd). Please regenerate the SAS token with the required permissions and retry the PowerShell command. If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Marcin Policht 69,125 Reputation points MVP Volunteer Moderator
    2025-12-15T23:40:24.49+00:00

    "C:\Windows\System32>azcopy.exe" is not a valid file system path.

    If azcopy.exe indeed resides in the C:\Windows\System32 directory, then you should specify "C:\Windows\System32\azcopy.exe" instead


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.