Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How could I erase the whole word with using Ctrl-Backspace in Windows XP command line? Is it possible at all?

share|improve this question

5 Answers 5

CMD or Powershell doesn't have a native shortcut to delete the word to the left or right. Here are some examples of what each platform can do. What you could probably do to make it a little easier is use the shortcut to move to the beginning or end of a word and start deleting or backspacing to delete the word.

share|improve this answer

AHK Code to replicate Ctrl+Backspace functionality to delete previous word. What this does is selects the previous word with Ctrl+Shift+Left, and then presses delete. Works well enough for me in notepad, and other programs, though is bit wonky in win7. Can't confirm for terminal right now.

^BackSpace:: ;;Delete previous word
    Send ^+{Left}{Del}
 Return
share|improve this answer

try this instead:

^BackSpace:: ;;Delete previous word
Send ^+{Left}
Loop, 500 {
    Send {Del}
}
Return

it modified the previous answer by sending 500 deletes after positioning at the previous word. 500 may be excessive, but so what.

this is for autohotkey (http://www.autohotkey.com/) and works in a cmd window, I put it in my cmd window specific section with the paste code like this:

#IfWinActive ahk_class ConsoleWindowClass
; Paste in command window
^V::
Send !{Space}ep
return

^BackSpace:: ;;Delete previous word
Send ^+{Left}
Loop, 500 {
    Send {Del}
}
Return

#IfWinActive
share|improve this answer

I think it should be better if select more Shift + Left, because it can select the backspce after/before the word. for example:

^w:: ;;Delete previous word
    Send ^+{Left}+{Left}
    Loop, 5 {
        Send {Del}
    }
Return
!d:: ;; Delete backward word
    Send ^+{Right}+{Rigt}
    Loop, 5 {
        Send {Backspace}
    }
Return
share|improve this answer

It's not possible natively in the Windows command prompt.

share|improve this answer

Your Answer

 
discard

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.