Close program running on remote server

Is there a way to close a program running on a remote server by running a php script (via cron) that first checks to see if a specific program is running (Quick Books in my case) & if it is, closes it?

I think the server is running WindowsServer 2012; that was not an available topic.

Richard KortsAsked:
Who is Participating?
I think the approach you are thinking of could result in data loss.
is Remote connection not an option?
Is quickbooks local or cloud based?

taskkill can terminate the program.

please clarify
Gerwin Jansen, EE MVETopic Advisor Commented:
cron is not running on a Windows server, you could use psexec to connect and then kill a task as suggested. Or remotely create a scheduled task that does the kill.
Davis McCarnOwnerCommented:
You need to be very careful or you will damage the QuickBooks data file!
QuickBooks (2007 or newer) has two components; a database server which should ONLY be running on the PC hosting the data file and QuickBooks itself.  All too often, whomever installed QuickBooks wasn't paying enough attention and did not choose the proper installation for each PC which results in multiple PC's running the database server and every PC launching QB at startup.  2012 (?) and newer also add a data protect program which is for a subscription service that backs up the QB data file to Intuit's cloud.
If users are RDPing into the server and running QuickBooks, you should probably leave it alone.  If the server is the host for the data file, you can use the Startup options to disable QB (and data protect if they're not paying for it) on the server then kill the task or reboot.
I; however, have not seen any version of QB since 2006 that doesn't fill the event logs with errors (mostly event id 4).  Intuit says its not a problem though they do slow the PC down each time an event is logged.
You would do yourself a favor to explain why you want to clobber QB and tell us if QB is being run as an RDP program along with the version.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.