Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: In DOS, how to include a Pipe | character to pipe it to CLIP  (Read 59352 times)

0 Members and 1 Guest are viewing this topic.

april

    Topic Starter


    Rookie

    In DOS, how to include a Pipe | character to pipe it to CLIP
    « 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.

    Hackoo



      Hopeful
    • Thanked: 42
    • Experience: Expert
    • OS: Windows 10
    Re: In DOS, how to include a Pipe | character to pipe it to CLIP
    « Reply #1 on: June 09, 2022, 04:25:16 PM »
    You can give a try with this batch file :
    Code: [Select]
    @echo off
    Title Get ClipBoard with Batch
    echo ABC^|DEF^|GHI>"%Temp%\%~n0.txt"
    Type "%Temp%\%~n0.txt" |Clip