How to pass an argument that starts with “//” to a wsh script?

后端 未结 2 1433
野趣味
野趣味 2021-01-12 17:56

If I have the following script (that just prints the first argument to the console):

@if (@X)==(@Y) @end /* JScript comment
    @echo off
    cscript //E:JSc         


        
2条回答
  •  囚心锁ツ
    2021-01-12 18:15

    It works with named arguments after all.

    WScript.Echo(WScript.Arguments.Named.Item("test"));
    

    and

    cscript myscript.wsf /test:"//test"
    

提交回复
热议问题