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
link|improve this question

74% accept rate
feedback

1 Answer

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
}
link|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
feedback

Your Answer

 
or
required, but never shown

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