Saturday, March 26, 2016

Drive letters that aren't letters

An interesting thing about the subst command is that it will allow you to assign drive letters that aren't letters. For instance,

subst 1: C:\path\test

completes successfully, and you can change to the 1: drive in that command prompt. As far as I can tell, this works with all characters that aren't spaces. Unicode characters work too, but they'll render as a question mark (though they aren't garbled into one).

Closing the command prompt and opening a new one keeps the substitutions working. Unfortunately, it seems that only the command prompt is in on the joke, because other programs like Explorer won't handle it. Not even \\?\ paths help, so these "letters" are probably just a cmd facade.

No comments:

Post a Comment