AngelsandDemons
AngelsandDemons

Reputation: 2853

Prompt for user input on Command prompt using Javascript

One of my team uses DSS for running javascript on the windows command prompt for some chip designing purpose.

Now there requirement is to prompt a user for an input on command prompt and they want it to do using Javascript function.

I have tried alert and prompt but I have a feeling that it is not possible to prompt the user for an input on command prompt using Javascript.

The script is used of some kind of CCS thing.

Can anyone please guide us as to how can we prompt for a user input on command prompt using JAVASCRIPT.

Upvotes: 1

Views: 3448

Answers (2)

KooiInc
KooiInc

Reputation: 123016

You can use StdIn:

WScript.StdOut.Write('please enter your input: ');
var myInput = WScript.StdIn.ReadLine();

Upvotes: 3

Luka Ramishvili
Luka Ramishvili

Reputation: 899

Since you're using windows, the easiest way is to use JScript engine. It can use almost all windows internal functionality.

Here's an explanation on how to use input/output:

http://msdn.microsoft.com/en-us/library/c61dx86d%28v=vs.85%29.aspx http://www.aspfree.com/c/a/Windows-Scripting/Handling-User-Input-in-WSH/ http://technet.microsoft.com/en-us/library/ee156599.aspx

Upvotes: 0

Related Questions