我有一个小的命令行JScript例程,我通常使用Windows中的cscript从命令行运行。我希望能以……的方式传递论点。
%:>cscript doSomethingToFile.js FileInQuestion.txt对如何做到这一点有什么见解吗?
发布于 2012-07-13 05:24:18
伯纳德·马克思
xx.js
alert = function(s){WScript.Echo(s)}
var arg = WScript.arguments(0)
alert(arg.toUpperCase() + " now upper case")
...(假设在C:>提示符):
C:\> windows\wscript.exe xx.js "apples and bananas"https://stackoverflow.com/questions/3054404
复制相似问题