简体   繁体   中英

Put multiple lines with special characters into clip using windows batch-file

So, currently I've tried to do it like this:

@echo off
(
    echo <script type=&quot;syntaxhighlighter&quot; class=&quot;brush: csharp&quot;><![CDATA[
    echo ]]></script>
) | clip

I also tried to encapsulate each line with "", but this way quotes are printed too. Putting ^ character before each of the special characters seem to break the script completely. Like this:

echo ]]^>^</script^>

You may use this method:

@echo off
< NUL (
    set /P "=<script type=&quot;syntaxhighlighter&quot; class=&quot;brush: csharp&quot;><![CDATA["
    echo/
    set /P "=]]></script>"
    echo/
) | clip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM