Using website to stop and launch applications on same machine

  ajax, jquery, php, windows

I am in the process of setting up a website for users to sign up for accounts to access applications on a server running Windows Server 2019 with IIS, MySQL, PHP, and FastCGI.

The website works fine, the applications work fine, but it becomes rather tedious to have to login via RDP to restart an application if it hangs up, needs a manual update, etc. I have tried searching via google, and came up empty on this, but is there a way via php, jquery/AJAX, etc., to click a button on my website’s admin panel to send a command to Windows to shutdown and/or restart an application?

Example:

Let’s say I have my website located at C:/webroot/htdocs/" and an application at "C:/servers/server1/server.exe

I want to send a command from the website to close any active windows for server.exe (the console window(s)) if I hit "Stop Server" on the webpage. If I hit "Start Server" it will send a command to launch the server.exe program. Finally, if I hit "Restart Server" it will perform the stop action, followed by the start action in a single click.

Is this possible without needing to purchase any type of third-party application?

I know there are cron jobs, but I am not sure exactly how to utilize them, especially in this type of scenario.

Source: StackOverflow

LEAVE A COMMENT