0

For complicated reasons, I have been forced to make an identical copy of cmd.exe and rename it to cmd-2.exe, which I put a shortcut to in the Taskbar. The reason is purely to have them "grouped" in different "taskbar groups", and nothing else.

Sometimes, I forget about this, and to open a new cmd.exe, I simply middle-click that Taskbar icon to open a new cmd.exe. Then I type a command such as "dir", and then it spits out a bunch of nonsense, including:

DNS bad key.

This only happens if I accidentally use the cmd-2.exe. Not if I open the "real" cmd.exe. So it's not a "practical" problem.

However, I wonder why that message is ever printed at all. It's apparently failing to do some kind of DNS lookup or something? Why is DNS involved at all with me typing "dir" to list files in my local computer? I have no network set up, no "cloud drives", nothing like that whatsoever. It scares me that (apparently) there are DNS queries being made when I type "dir".

Or maybe "DNS bad key" refers to something completely unrelated to the Domain Name System? I don't know what a "bad key" would even be in that context...

  • 3
    Can you provide a screenshot showing the "bunch of nonsense", the DNS message, and any of the normal shell printouts when opening a new window? As it is we've got only partial information to work with. – gowenfawr Feb 10 '20 at 15:28
  • 1
    This likely belongs on superuser or serverfault, as it's more of a "what is the program doing?" rather than "I found a real security issue". People familiar with windows are going to be better acquainted with how how cmd.exe works. – Steve Sether Feb 10 '20 at 16:33

1 Answers1

4

The error is not related to DNS, it is read wrong from the error DB file.

This happens because you second cmd-2.exe fails to locate and load the localized strings from the cmd.exe.mui resource library (its Error message DB).

The problem occurs starting from Windows Vista. All the text messages are compiled into a separate file (a .mui), so Windows would search for a message file with your new CMD name and will fail to find it.

To fix the problem: copy in the folder %WinDir%\System32\en-US (or your language) the file cmd.exe.mui to cmd-2.exe.mui .

Not doing that will result in strange unrelated messages.

Overmind
  • 9,924
  • 4
  • 25
  • 38
  • That does fix them, but I get "The system cannot write to the specified device." when cancelling the `dir` command. What's up with this? – Unknow0059 Apr 08 '22 at 18:56