Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I m looking for a way to map CNTRL+p and CNTRL+n in command prompt to previous and next command in history. I m aware of F3 and up/down key but I m habituated to CNTRL+p/n on linux.

share|improve this question

migrated from May 29 '12 at 10:10

This question came from our site for professional and enthusiast programmers.

CMD also supports arrow keys (/) to navigate the command history. Pretty addictive hotkeys they are. – Andriy M May 29 '12 at 7:19
yeah I know about that , but its faster with cntrl+p/n as they are almost below the finger. Going and pressing those arrow keys is pain . – Vihaan Verma May 29 '12 at 7:33
up vote 1 down vote accepted

You can translate Ctrl-P, Ctrl-N to Up and Down keys with AutoHotKey.

    send {Up}

    send {Down}

You can limit the translation to happen only in Cmd.exe window:

    IfWinActive, Your-command-window-title...
        send {Up}
    } else {
        send ^P

    (similar to above)

Well, I'm in Linux box, so I don't know the exact window title of cmd.exe, check it yourself.. Hope it works!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.