【问题标题】:Send argument to batch file containing special characters将参数发送到包含特殊字符的批处理文件
【发布时间】:2018-03-13 02:57:24
【问题描述】:

如何将http://httpbin.org/get?course=networking&assignment=1 作为参数发送到批处理文件?

【问题讨论】:

    标签: batch-file arguments special-characters


    【解决方案1】:

    这是一个单独的参数,所以只需将它放在双引号内!

    可能是这样的:

    "MyScript.cmd" "http://httpbin.org/get?course=networking&assignment=1"
    

    或者可能是这样的:

    Call "MyScript.cmd" "http://httpbin.org/get?course=networking&assignment=1"
    

    【讨论】:

    • 另外添加,当引用参数时添加波浪号,如%~1,当你想去掉引号时,或"%~1" 明确引用值。示例:set "url=%~1" 将 %url% 设置为未引用的值,或 wget "%~1" 引用该值。
    • @davidXman,您的问题是特定于发送参数,没有收到。有关接收已发送参数的信息,请参阅上面的评论。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-18
    相关资源
    最近更新 更多