in reply to Windows command line

(my $copy = $ARGV[0]) =~ s/([^[:print:]])/sprintf " (0x%02x) ", ord $1 +/ge; print $copy;

The above piece of code can help you figure out windows' interpretation of what you keyed. It prints all the non-printable chars as hex.

For example, if you punch "Ctrl-^" "w", which appears on your screen as "^^w" (I guess that's how you get it), this program tells you window takes that "Ctrl-^" as 0x1e.

Update:

At one point, I had the same thought as BrowserUK, that ^ is an escape char, but after I tested on my PC, it does not behave like that... so not all versions. (well I am still running win98)

Replies are listed 'Best First'.
Re: Re: Windows command line
by BrowserUk (Patriarch) on Oct 18, 2003 at 17:02 UTC

    Indeed. I should have emphasised the CMD.EXE.

    Win95/98 (I'm not sure about ME) all use COMMAND.COM as their CLI, which has a completely different set of (equally unwritten:) rules.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!

Re: Re: Windows command line
by dda (Friar) on Oct 18, 2003 at 15:58 UTC
    Thanks, pg. But I didn't "key" or "punch" anything. I just typed "^" (shift-6).

    I'll investigate this some more.

    --dda