How do I deal with emoji in Command Prompt?
Solution 1:
I experimented quite a bit with emoji in cmd, and these are the conclusions that I came to:
- In most cases, you can substitute the emoji with
??
.
This is what thenetsh wlan show profile
(which lists all the network profiles) command shows me:
In the above case, you can simple run the commandnetsh wlan show profile 12346??
. -
But... CONFLICT! What if there are two identical SSIDs, just with different emoji?
To test this out I created a second hotspot with the SSID12346๐
. CMD obviously couldn't differentiate.
But the output ofnetsh wlan show profile 12346??
had something interesting:Profile 12346?? on interface Wi-Fi: ======================================================================= Applied: All User Profile Profile information ------------------- Version : 1 Type : Wireless LAN Name : 12346?? Connectivity settings --------------------- Number of SSIDs : 1 SSID name : "12346dY~?" [[REDACTED IRRELEVANT INFO]] Profile 12346?? on interface Wi-Fi: ======================================================================= Applied: All User Profile Profile information ------------------- Version : 1 Type : Wireless LAN Name : 12346?? Connectivity settings --------------------- Number of SSIDs : 1 SSID name : "12346dY?ยท"
First we notice that cmd (very smartly) runs the command for both SSIDs. But we only want to run it for one SSID...
Secondly, we see that one has been assigned the SSID12346dY~?
, and the other12346dY?ยท
. However, using either of these in the command just gives us an error... Bummer! So what do we do?? Pretty simple, you use the Touch Keyboard (on Windows 10) to insert the emoji into the console, or you can copy-paste the emoji from elsewhere, both work perfectly, even though the emoji isn't displayed properly.
What about Files and Folders? I created two folders,
๐
and๐
. This is whattree
shows: Luckily for us though, we can simply use tab to circle through the folder names at the prompt, but again, we have no way of actually viewing the folder names. In this case, one option is to rename the folders by using theren
command. Another option is to use thedir
command to inspect the properties of the files/folders and determine which one you need.Just use ConEmu!
ConEmu apparently has better unicode support: