0

I am working on a batch script that runs .exe files in a given folder. It should do something like this:

SET /P _inputname= Please enter app folder path:
cd %_inputname%
dir  /s /b *.exe | clip
"paste-from-clipboard"

However, for my last line, I haven't found a way to paste from clipboard without using a mouse/keyboard shortcut. I would greatly appreciate it if anyone has a solution.

JS4137
  • 314
  • 2
  • 11
  • Please describe what your script should do! Copy dir's exe files to clipboard and paste again, in order to execute in sequence? – hc_dev Apr 12 '20 at 22:19
  • Make your own paster https://winsourcecode.blogspot.com/2019/05/printclipexe-prints-any-text-or.html. Or `for %a in ("*.exe") Do %a` use `%%a` in a batchfile. –  Apr 12 '20 at 22:59
  • The question is why are you sending something to the clipboard, only to retrieve it again? If your reason is that you're not retrieving it immediately, why not send it to a file, then read the file back in when necessary. – Compo Apr 12 '20 at 23:02

1 Answers1

0

To copy & paste within windows command line you can use: https://github.com/kpym/windows-paste

It's the successor of the once famous paste.exe.

See also How can you get the clipboard contents with a Windows command?

hc_dev
  • 8,389
  • 1
  • 26
  • 38