簡體   English   中英

使用Windows批處理文件將帶有特殊字符的多行放入剪輯

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

所以,目前我試圖這樣做:

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

我還嘗試用“”封裝每一行,但這樣的引號也被打印出來。 在每個特殊字符之前放置^字符似乎完全破壞了腳本。 像這樣:

echo ]]^>^</script^>

您可以使用此方法:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM