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?

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

    Calmly visit these people are tell them politely that if they continue to shutdown the program you’ll enforce a password change every morning

  • 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.
  • anh86@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    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?