Typing the tilde ~ character in DOS

Agifoto picture Agifoto · May 8, 2009 · Viewed 14.6k times · Source

In my DOS prompt I have to put in a tilde (~) character to open any files.

For some reason it won't show up in the DOS box/prompt.

Is there any form of Ctrl shortcut key thing that could get me to typing a ~ character?

It's only the DOS prompt that won't recognize that key is what gets me the most though.

Answer

RichieHindle picture RichieHindle · May 8, 2009

Hold down the Alt key and type 0126 (zero one two six) on the numeric keypad. That is the ascii value of that character.

GWBasic:

10 a$="~"
20 ? asc(a$)
run
126

In DOS you need to begin with a 0 + value you need for other symbols and it only works on the numeric keypad.