I would want to copy a text to the clipboard using batch script so I don't have to open a text file to select all text and copy. I tried this code:
echo | set /p= hello & echo.world |clip
Output
world
Expected clip (desired)
hello
world
but it only clipped:
world
What are options so I can copy and paste multiple line text or paragraph using batch file? Thanks!
Like Nico wrote, if you have several lines of text, then you’ll need to wrap them in brackets ()
like this:
echo off | clip
(
echo This is line one
echo This is line two
echo this is line three
)| clip
More information about it you can find here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With