question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error "'C:\Program' is not recognized as an internal or external command" when running az role assignment create cmd

See original GitHub issue

Describe the bug Running the 1st bash script in doc Authenticate with Azure Container Registry from Azure Kubernetes Service, last cmd generates error

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Other az-cli cmds work in the same environment so far.

Environment summary Windows 10, git bash in mingw64, alias az=az.cmd

$ az --version
azure-cli                         2.0.62 *

acr                                2.2.4 *
acs                               2.3.21 *
advisor                            2.0.0
ams                                0.4.4 *
appservice                        0.2.17 *
backup                             1.2.3 *
batch                              4.0.0
batchai                            0.4.8
billing                            0.2.1
botservice                        0.1.10
cdn                                0.2.2 *
cloud                              2.1.1
cognitiveservices                  0.2.5
command-modules-nspkg               2.0.2
configure                         2.0.21 *
consumption                        0.4.2
container                         0.3.16
core                              2.0.62 *
cosmosdb                           0.2.9 *
dla                                0.2.5
dls                                0.1.8 *
dms                                0.1.3
eventgrid                          0.2.2 *
eventhubs                          0.3.4
extension                          0.2.5
feedback                           2.2.0 *
find                               0.3.2
hdinsight                          0.3.3
interactive                        0.4.3
iot                                0.3.7 *
iotcentral                         0.1.6
keyvault                          2.2.14
kusto                              0.2.2
lab                                0.1.6 *
maps                               0.3.4
monitor                           0.2.12 *
network                            2.3.6 *
nspkg                              3.0.3
policyinsights                     0.1.2
privatedns                         1.0.0
profile                            2.1.5
rdbms                              0.3.9 *
redis                              0.4.2
relay                              0.1.4
reservations                       0.4.2
resource                          2.1.13 *
role                               2.5.0 *
search                             0.1.1
security                           0.1.1
servicebus                         0.3.4
servicefabric                     0.1.16 *
signalr                            1.0.0
sql                                2.2.1 *
sqlvm                              0.1.1
storage                            2.4.0 *
telemetry                          1.0.2
vm                                2.2.18 *

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
jiaslicommented, Jul 23, 2020

This is a bug in Git Bash itself, irrelevant to Azure CLI.

To reproduce, create a cmd file with spaces in the path, such as D:\path with space\test.cmd:

echo Hello World

Directly invoking this file works:

$ test.cmd

C:\Users\xxx>echo Hello World
Hello World

$ "D:\path with space\test.cmd"

C:\Users\xxx>echo Hello World
Hello World

But it fails when a parameter with space is provided:

$ test.cmd "a b"
'D:\path' is not recognized as an internal or external command,
operable program or batch file.

$ "D:\path with space\test.cmd" "a b"
'D:\path' is not recognized as an internal or external command,
operable program or batch file.
2reactions
abbrcommented, Apr 25, 2019

yes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Prompt Error 'C:\Program' is not recognized as an ...
I am using MSSQL to execute a command, EXEC xp_cmdshell 'C:\"Program Files"\7-Zip\7z.exe a "C:..... – YHTAN. Mar 24, 2020 at 9:22. Add a...
Read more >
Azure CLI 'C:\Program' is not recognized as an internal or ...
Unable to run any Azure CLI commands from CMDER, keep getting the error: 'C:\Program' is not recognized as an internal or external command, ......
Read more >
5 Ways to Fix the "Not Recognized as an Internal or External ...
Here's how to fix that. fix not recognized as internal external command cmd. The Command Prompt in Windows is a handy utility.
Read more >
Command Prompt Error 'C:\Program' is not recognized as an ...
Solution:You need to put the command in double quotes ".If a directory has white spaces in, put quotes around it. This includes the...
Read more >
'C:\Program' is not recognized as an internal or external ...
After a lot of try, Finaly i SOLVE the problem on windows (over MinTTY). The solution is change installation path:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found