Javascript execute Batch files and output in the webpage

For a project requirement, need to execute the batch files with arguments through javascript and output results in the webpage itself, the web page contains a button and textbox, when we click the button it execute the batch files and the result display below text box (without page refresh).

The output of the batch files contains hundred of lines it need to display the text box, so the user would have a feel like they execute the batch file through command prompt.

Once the script ran the output need to export to a text file with another button click.

Please help me get the above done using javascript or jquery.

Thanks.

Welcome to the forums, @progguru.

I’m sure there will be members willing to help you with your code. Please post the code you are working with, so they can see how far you’ve got and where any errors lie.

To post code in the forums, you can highlight your code, then use the </> button in the editor window, which will format it.

Or you can place three backticks ``` (top left key on US/UK keyboards) on a line before your code, and three on a line after your code. I find this approach easier, but unfortunately some European and other keyboards don’t have that character.

I’m not sure what you’re asking, but both running executable files and writing files are System operations and as such are not anything JavaScript can do directly on its own.

There are major security implications. That is, this is not something a website can do with users’ computers.

On the other hand, if this is about putting together an GUI for an intranet, you should be able to tie it into to other intranet operations.

But as TechnoBear posted. This is not a trivial task and an outline and code examples of what you have so far are needed.

Hi @progguru,

if Php is available I would include the text file between a div with the style set to display:none and use the JavaScript button to change the div to display:block;

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.