Powershell/CMD 无法识别 PATH 变量

Powershell/CMD is not recognizing PATH variable

Windows11/Powershell 7.2.1

我已将以下变量添加到用户 PATH 和系统 PATH。 C:\Program Files\rclone\rclone-v1.57.0-windows-amd64\rclone.exe

当我尝试从 Powershell 或 cmd 运行 rclone 时,我收到以下消息:

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

成功 运行 refreshenv 只是为了确保我重新启动 Windows。 在 运行ning $env:path -split ";" 之后,我可以看到 C:\Program Files\rclone\rclone-v1.57.0-windows-amd64\rclone.exe 设置正确。

我可以从程序文件夹中 运行 rclone 我收到此通知。

PS C:\Program Files\rclone\rclone-v1.57.0-windows-amd64> rclone rclone: The term 'rclone' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Suggestion [3,General]: The command rclone was not found, but does exist in the current location. PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\rclone". See "get-help about_Command_Precedence" for more details.

在 PATH 上设置 rclone 后仍然没有“看到”,我在这里做错了什么?

您必须指定包含 rclone.exe 的目录而不是可执行文件的路径。您应该将 C:\Program Files\rclone\rclone-v1.57.0-windows-amd64 添加到 PATH enveronement 而不是 C:\Program [=16= .57.0-windows-amd64\rclone.exe