How can I prompt the user to enter a value in WSH JavaScript?

59 views Asked by At

I tried all the possible ways to enter a value from the user but none of those actually worked; I wrote these codes in my notepad and saved with .js extension;

For example:

1.

var input = WScript.CreateObject("WScript.Shell")
  .InputBox("Enter a value", "User Input", "");
WScript.StdOut.Write("Enter a value: ");
var input = WScript.StdIn.ReadLine();
var input = prompt("Enter a value:");
var number2 = Val(WScript.StdIn.ReadLine());
var numberInput = shell.InputBox("Enter a number", "Factorial Calculator");
var number = parseInt(numberInput);

In most of these codes, the result says object does not support this property or method

0

There are 0 answers