Script not recieving url properly

前端 未结 3 1738
独厮守ぢ
独厮守ぢ 2021-01-19 07:31

I am using a combined batch and java script I found to retrieve the html from a web site using a batch file and one we address is not returning the desired output as it appe

3条回答
  •  借酒劲吻你
    2021-01-19 07:50

    call the cscript like that:

    cscript //E:JScript "%~dpnx0" "%~1"
    

    I dont think the spaces needs to be encoded but rather the double quotes (with %22) though this could require to parse the whole command line (%*) you can try something like

    setlocal enableDelayedExpansion
    set "link=%*"
    set "link=!link:"=%%22!"
    ....
     cscript //E:JScript "%~dpnx0" "%link%"
    

    You can also try with named arguments and pass the whole command line to the script.

提交回复
热议问题