Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
russs
- Posts: 3
- Joined: 29 Nov 2010 05:15
#1
Post
by russs » 10 Oct 2011 07:00
Hello,
I want to copy a whole text (with many lines) into clipboard.
I have succeeded to copy a 1-line text with the following batch:
This puts "my text" into the clipboard, the problem is I want a much longer text (a paragraph with many lines) to be copied to the clipboard, can you please help ?
Thank you in advance
-
dbenham
- Expert
- Posts: 2461
- Joined: 12 Feb 2011 21:02
- Location: United States (east coast)
#2
Post
by dbenham » 10 Oct 2011 11:54
Presumably you have multiple lines of code that generate the text. You just need to make sure that all of the text that is to be captured is directed to the clipboard with the same pipe.
This is trivial if you have a batch file that generates the text. Simply call the batch file and pipe the output
If you want to capture the output of some block of code within a batch file, just enclose the block in parentheses:
Bear in mind that if you use variable expansion and the variable is set within the block, then you will need to use delayed expansion because the entire block will be expanded prior to any execution if you use normal % expansion.
Dave Benham
-
russs
- Posts: 3
- Joined: 29 Nov 2010 05:15
#3
Post
by russs » 12 Oct 2011 04:14
Thank you Dave, that worked !