Convert console commands to Javascript?

It is possible to create buttons on a web page (on my own computer) so that it will execute console commands? Instead of opening the Mac or PC console or terminal apps, clicking on a button will open the console or terminal app and execute the command? Could we input the starting directory in a text field and make the console start from that directory to run its commands?

Of course, those commands will be part of the built-in button functionality.

I just wonder if it’s possible with Javascript or other programming language as fields and buttons on a web page.

Sorry no - JavaScript’s security just doesn’t allow that sort of thing to occur.

As Paul says, JavaScript executed by a browser, doesn’t allow that sort of thing to occur due to security concerns.
On Windows, one would normally write a DOS batch script for such tasks.

It is however, also worth mentioning that Windows Script Host ships with an engine that support JScript (Microsoft’s implementation of JavaScript), meaning that you can also use JavaScript for scripting tasks on Windows machines.

I was looking at it recently to mount a TrueCrypt volume on boot.
See also: http://stackoverflow.com/questions/1582867/tutorial-for-using-javascript-on-a-desktop

Thank you, Paul. Makes sense.