Computer Hope
Microsoft => Microsoft DOS => Topic started by: april on April 06, 2022, 08:23:56 AM
-
Thank you in advance for any help
I need to pipe some text to CLIP in a DOS batch file. Problem I have is the text contains a PIPE character |.
For example, the text is abc|def. I need the clipiboard to show abc|def as well.
Here's what I've tried so far without success.
echo abc|def|CLIP
The result is an error
'def' is not recognized as an internal or external command,
operable program or batch file.
echo abc^|def|CLIP
The result is an error
'def' is not recognized as an internal or external command,
operable program or batch file.
echo "abc|def"|CLIP
It kinda worked but the clipboard shows the text with the double quotes "abc|def"
I need the clipiboard to show abc|def
Please help.
Thank you.
-
You can give a try with this batch file :
@echo off
Title Get ClipBoard with Batch
echo ABC^|DEF^|GHI>"%Temp%\%~n0.txt"
Type "%Temp%\%~n0.txt" |Clip