I have a program on a work station that has to stay running and I keep having random people at work closing the program, is there a way to have the program automatically reopen?
You must log in or register to comment.
Calmly visit these people are tell them politely that if they continue to shutdown the program you’ll enforce a password change every morning
im thinking of a few options, depending on how much control you have over the program
- If you have the source code, and know a bit about the language / framework used, you can delete the parts of the program that handle closing / alt-f4 events. Then the only way to close it is via task manager / powershell
- Create a script to check if the application is open with `tasklist` / `get-process`, and open the application again if it isn’t. this would just be a .ps1 file that you would run on startup and have it loop every few seconds or so and check the state. i have a script similar to this that you can see if you want or you can ask chatgpt, it’ll be accurate
- im not sure exactly how to do this, but I know it’s possible; run the task on startup as an elevated user, and assuming that this environment is configured correctly (aka no-one has local admin perms) you can prevent apps from being closed by setting certain flags inside of the task scheduler.
How about a frequently scheduled task that runs a script to check if a process is running and if not run commands to stand it back up?