JSC.exe and a command prompt interface will allow you to compile JScript/JavaScript into a .Net executable right on your desktop.
JSC [JScript Compiler] has a -? or -help function that displays all of the compiler options and flags and is a standalone executable itself. Copy it to a folder of your choice then copy cmd.exe to the same folder and get to coding.Save your source with a .js file extension in the folder with your cmd and jsc executables. Yes, jsc.exe works with regular .js files, but JScript.net tutorials can show you how to build a GUI with buttons and everything for your .js file!
Compile your .js file by starting up the command-line shell (cmd.exe), in the same folder as jsc.exe and your .js file,type jsc then a space and then your .js file's name - hit enter - done. Additionally, jsc outputs debugger errors and warnings to the same cmd.exe that started it with the line and character positions in your .js file where the issue was encountered. You can also get debugging object output saved to a .pdb, for your .js file by typing jsc, a space then typing /debug a space and your .js file name.
- '/debug' = a forward slash then the word debug or...
- '-debug' = a minus or dash character then the word debug.
/ and - before a flag are managed/read identically, use what's best for you just make sure you don't put debug or any flags in quotations of any sort.
Easy peasy; jsc.exe will run from a usb thumb drive and flash memory cards alike with the only requirement being that the .Net Framework is installed in the host operating system. If you are running newer versions of Windows the .Net framework comes pre-installed anyway; go to the Windows directory/folder of your Windows OS and do a search for jsc.exe and you'll probably get a .Net version of jsc.exe for 2.0 and 4.0 minimally. Copy the version(s) you want to your chosen folder repeating the process to find the cmd.exe.
DONOT cut and paste jsc.exe and cmd.exe - only copy these executables to the directory you wish to run them from. Right click the file(s) and from the context menu click the copy menu selection option. Right click in the directory you created for jsc.exe and cmd.exe and click the context menu selection option paste. You can also single click the file to highlight it then press and the Ctrl key then press the C key to copy the file to the clipboard; single click to highlight or double click to open the directory you created then pressing and holding the Ctrl key press the V key to paste your files in your chosen directory.
Little known facts:
- JScript is Microsoft's implementation of ECMAScript Specification 5 compliant JavaScript and MSDN has excellent documentation on it as well as current JavaScript.
- cmd.exe supports drag and drop; so, you can drag and drop the jsc.exe on the command prompt, type a space then drag and drop your .js file on it, press enter to compile and enjoy.
- I don't work for Microsoft, but probably should.
The Mono .Net Framework for Linux might be able to support JScript.Net applications as well, but I have not looked into this topic for some time. The Mono Framework is a Linux compatible .Net Framework following the ECMA specifications for the .NET Framework following the CLS (Common Language Specification [generic com]). The Mono Framework supports a huge part of the ECMA specification and is largely compatible with the Microsoft .Net Framework.
Have a good one.