Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

this is the way i have done it for Windows 11 machine. I have set hotscreen to launch at startup and the script here runs 5 minutes after logon (this makes sure that the hotscreen app will have launched by the time it starts monitoring for it) . It will check whether the process (hotscreen.exe) rather than process id is running. If it is running then nothing happens for 30 seconds.

If it finds out that the process isnt running it removes my account from administrators group and forces an immediate logoff (that way i lose admin rights immediately) but it does add in another task for 6 hours later to re-add my account back to administrators.
I do have another admin account I could use if this failed, MAKE SURE YOU HAVE ANOTHER WAY TO ACCESS WHILE TESTING!

I am not going to publish the full script here because it has the ability to remove users from admin etc, happy to give pointers but i don't want the full script to be used for nefarious reasons by others.




# HotScreen Monitor - Runs at startup, checks every 30 seconds

$startTime = Get-Date

while ($true) {

    $elapsedTime = (Get-Date) - $startTime

    

    # Only check after 5 minutes

    if ($elapsedTime.TotalMinutes -ge 5) {

        $process = Get-Process -Name "hotscreen" -ErrorAction SilentlyContinue

        

        if ($process) {

            Write-Output "hotscreen.exe IS running - no action taken"

        } else {

            Write-Output "hotscreen.exe is NOT running - proceeding with admin removal"

THIS IS WHERE YOU WOULD ADD IN YOUR COMMANDS FOR WHAT TO DO IF HOTSCREEN ISN'T RUNNING

     }

}       

}