Perhaps you could use jsc: Compiling JScript code from the command line .
But you will have to replace the browser-related objects with WinForms objects, which means learning a new API or using the .NET WebBrowser object (a browser widget showing only the contents of the page, without bars, except for scroll bars) in the main window (form object) and program it for loading URLs to the page with your JS code.
Here is an excerpt from MSDN:
The WebBrowser control also allows you to display content created in the application or retrieve it from a database or resource file. Use the DocumentText or DocumentStream property to retrieve or set the contents of the current document as a string or data stream.
You can also manage the contents of a web page using the Document property, which contains an HtmlDocument object that provides controlled access to the HTML document object model (DOM) for the current page. This property is useful when used in conjunction with the ObjectForScripting property to implement two-way communication between your program code (Windows) and dynamic HTML (DHTML) code on a web page, which allows you to combine Web and Windows Forms controls in a single user interface. The Document property can be used to call script code methods from your application (Windows code). Your script code can access your application through the window.external object, which is a built-in DOM provided to access the host, and which maps to the object specified for the ObjectForScripting property.
The WebBrowser control is a managed shell for the ActiveX WebBrowser control and uses any version of the control installed on the user computer.
source share