I thought for some simple tests that just run a few commands i would try using some JavaScript and run it from the command line in Windows XP.
So for a quick test I crea
A good approach is to redirect all of the usual output like in a following examples. It will allow you to test JavaScript designed for web without needing to rewrite.
test.js
var console = {
info: function (s){
WSH.Echo(s);
}
}
var document = {
write : function (s){
WSH.Echo(s);
}
}
var alert = function (s){
WSH.Echo(s);
}
console.info("test");
document.write("test2");
alert("test3");
You can call the script like this:
Cscript.exe test.js firstParam secondParam
which will give you:
test
test1
test2