I have a small command line JScript routine that I usually run from the command line using cscript in windows. I'd like to be able to pass in arguments hopefully along the lines of...
%:>cscript doSomethingToFile.js FileInQuestion.txt
Any insight on how to do this? Thanks much.
From Bernard Marx
xx.js
alert = function(s){WScript.Echo(s)}
var arg = WScript.arguments(0)
alert(arg.toUpperCase() + " now upper case")
...
(assuming at C:> prompt):
C:\> windows\wscript.exe xx.js "apples and bananas"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With