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.

I have a script (batch file) to store some inside clipboard, and I need to automatize running and pasting action with auto hot key.

I tried the following code, but the code doesn't work with cmd.exe. I expect a function something like 'Paste clipboard'.

+F2::
Run "SCRIPT.bat"
Send {Control down}V{Control up}
Return
share|improve this question

1 Answer 1

up vote 2 down vote accepted

In a Command Prompt, Ctrl+V doesn't paste the clipboard.

One way you can paste the clipboard in a Command Prompt is Alt+Space, E, P. So you might try

Send !{Space}ep

To paste to other Windows programs as well, you can check if the current window is a Command Prompt or not as follows

IfWinActive, ahk_class ConsoleWindowClass
{
  Send !{Space}ep
}
Else
{
  Send ^v
}
share|improve this answer
    
It works fine with command line, but it doesn't work with other app. –  prosseek Sep 15 '11 at 16:26
    
@prosseek I added a way to check if the current window is a Command Prompt to my answer. –  Bavi_H Sep 16 '11 at 4:07

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.