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?

  • NedNoodleHead@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    im thinking of a few options, depending on how much control you have over the program

    1. 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
    2. 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
    3. 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.