在Windows XP上,是否有快捷键可以将剪贴板的内容粘贴到命令提示符窗口中(而不是使用鼠标右键)?

典型的Shift+Insert在这里似乎不起作用。


当前回答

我个人使用一个小的AutoHotkey脚本来重新映射某些键盘功能,对于我使用的控制台窗口(CMD):

; Redefine only when the active window is a console window 
#IfWinActive ahk_class ConsoleWindowClass

; Close Command Window with Ctrl+w
$^w::
WinGetTitle sTitle
If (InStr(sTitle, "-")=0) { 
    Send EXIT{Enter}
} else {
    Send ^w
}

return 


; Ctrl+up / Down to scroll command window back and forward
^Up::
Send {WheelUp}
return

^Down::
Send {WheelDown}
return


; Paste in command window
^V::
; Spanish menu (Editar->Pegar, I suppose English version is the same, Edit->Paste)
Send !{Space}ep
return

#IfWinActive 

其他回答

是的. .但尴尬。链接

alt +空格,e, k <——用于复制和 alt +空格,e, p <-用于粘贴。

而不是“右击”....开始你的会话(一旦你在命令提示窗口)通过按Alt/空格键。这将打开命令提示窗口菜单,您将看到熟悉的带下划线的键盘命令快捷方式,就像Windows GUI一样。

好运!

谢谢,巴勃罗,为参考AutoHotkey实用程序。 因为我已经安装了Launchy,它使用Alt+Space,我必须修改它,但添加Shift键如下所示:

; Paste in command window
^V::
; Spanish menu (Editar->Pegar, I suppose English version is the same, Edit->Paste)
Send !+{Space}ep
return

这里有一个免费的工具可以在Windows上做这件事。与脚本相比,我更喜欢它,因为它易于设置。它作为一个快速本机应用程序运行,适用于XP及以上,具有配置设置,允许重新映射复制/粘贴/选择键的命令窗口:

另外,我了解开发者。

我花了一点时间来弄清楚为什么你的AutoHotkey脚本不适合我:

; Use backslash instead of backtick (yes, I am a C++ programmer).
#EscapeChar \

; Paste in command window.
^V::
StringReplace clipboard2, clipboard, \r\n, \n, All
SendInput {Raw}%clipboard2%
return

事实上,它依赖于击键,因此也依赖于键盘布局! 所以当你像我一样不幸只有AZERTY键盘时,你的建议就行不通了。更糟糕的是,我发现没有简单的方法来替换SendInput方法或扭曲它的环境来修复这个问题。例如SendInput "1"不发送数字1。

我必须把每个字符都转换成统一码,才能在我的电脑上使用:

#EscapeChar \

; Paste in command window.
^V::
StringReplace clipboard2, clipboard, \r\n, \n, All
clipboard3 := ""
Loop {
    if (a_index>strlen(clipboard2))
     break 
    char_asc := Asc(SubStr(clipboard2, a_Index, 1))   
    if (char_asc > 127 and char_asc < 256)
     add_zero := "0"
    else
     add_zero := "" 
    clipboard3 :=  clipboard3  . "{Asc " .  add_zero . char_asc . "}"
}
SendInput %clipboard3%
return

不是很简单……