Executing a Windows Batch file via Button Click

I have Outsystems running over Java Stack. I am trying to create a web application where with a click of a button, I want to execute a .bat file which is present in my windows desktop. Is it possible to execute the bat file with any pre defined action? Or is it possible to execute the .bat file by calling a javascript action which gets executed by button click? Note: This is only being used by 2 or 3 users only, who would have the .bat file in their desktop (or in the C:\Windows\System32 folder)

Hi Somesh,

This is not possible. For security reasons, a web browser cannot run a file on the local computer. Imagine if that was possible, a malicious website could take over your computer!

Hi Somesh,


I think that whatever you are planning is not ideal! (because of all the Kilian said)

But if this was critical for the success of a project of mine I would probably try doing some ActiveX control, and even this would only work in Internet Explorer (even Edge won't run them).

Hope this helps!

Again, not ideal- but one solution:

Could you store the bat or a small exe as a resource in your application, and the button the user clicks would download it? Then all they would have to do is open the downloaded exe or bat to run (one or two extra clicks?)