-1

I have one batch file in my local,I want to run it from browser

For example I have one html page with anchor tag If I click on that link then it should run a batchfile provided in href attribute.

Thanks in advance.

  • You could register a [custom protocol handler](https://stackoverflow.com/questions/7087728/custom-protocol-handler-in-chrome) – Anon Coward Feb 15 '22 at 15:26
  • 2
    For obvious reasons you can't just run an executable on someone else's computer. You could provide the batch file as a download, and let the user decide if they want to execute it. – Chris Hamilton Feb 15 '22 at 16:27

1 Answers1

1

Web browsers run JavaScript code in a "sandbox", specifically to prevent exactly what you want to do, because it's an enormous security risk.

In short, you shouldn't, and can't do that.

GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67