As far as I remember, I've always used ipconfig /all without a problem in MSYS2 bash shell.

But today, I just noticed something weird; in the Windows 10 Command Prompt (cmd.exe), I can type either:

C:\>ipconfig

Windows IP Configuration


Ethernet adapter Ethernet:
....

... or:

C:\>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : DESKTOP-MYPC
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Ethernet:
...

... and they both work fine.

When I go over to a MSYS2 bash shell, however, just using ipconfig (or ipconfig.exe) works fine - but when I try to add /all, it fails:

$ ipconfig.exe /all

Error: unrecognized or incomplete command line.

USAGE:
    ipconfig [/allcompartments] [/? | /all |
...

... which I found really weird. Just in case, I tried to double the forward slash, and then it works (?!)

$ ipconfig.exe //all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : DESKTOP-MYPC
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
...

Now, if this was a backslash, I'd understand what the problem is (considering backslash is escape character in bash) - but I really don't get it, why would a forward slash need to be doubled, to get this command to work in MSYS2?!

Would anyone have an explanation, why am I seeing a failure in MSYS2 bash if I use ipconfig /all, but it works if I use ipconfig //all?

0 Answers