Computer Hope

Software => Computer programming => Topic started by: JLawrence on November 24, 2020, 06:36:15 AM

Title: Multiline variable in Batch script
Post by: JLawrence on November 24, 2020, 06:36:15 AM
For work I frequently need to email the same emails to users who need my assistance. Things like "I'm glad I was able to assist you, if you need ..."
I have a few scripts that write those variable to my clipboard so  I just need to paste them into my email.  Is there a way to turn an output of
I'm glad I could help Joshua
into
I'm glad I could help
Joshua


here is the script I have already.


echo|set /p="Glad I could helpJoshua"
paste | command | clip



and with that i need to go back and put an enter in.  Is there a better way?




Title: Re: Multiline variable in Batch script
Post by: Sidewinder on November 24, 2020, 03:31:59 PM
Not sure about a better way, but this will get two lines on the clipboard:

Code: [Select]
(echo Glad I Could Help && echo Joshua) | clip

Tested on Win10 using Notepad to paste data from clipboard.

Good luck,  8)