0

How do i run batch from the web locally? I'm trying to kill a process locally (sas.exemy own file) but from web.

2
  • 7
    Think about the security and usability implications if websites were allowed to kill arbitrary processes on your machine. That would be a disaster. Commented May 18 at 19:01
  • Neither a batch file or cmd.exe is required to 'kill' a task/process. There are independent utilities already in your Operating System designed for just that. Commented May 18 at 23:11

1 Answer 1

2

You can't. JavaScript code running in the browser has a very limited scope.

This requires a client application to which you send the request. The client runs directly on the operating system, so it has the ability to execute CMD commands and can therefore also stop processes.

You can issue the command to stop sas.exe from the website; this request can reach the server, and from the server, you need to be able to communicate with the desktop client application to request the process termination. So, it's not impossible, but on its own, a website cannot execute such a command.

If you're hosting the website on your own machine, you can issue the command from the web, and even without a client application, the backend server may be able to execute actions like stopping an sas.exe process. However, this can only be executed on the server.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.