GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ahk-utils/procguard

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSE
LICENSE
 
 
README.md
README.md
 
 
procguard.ahk
procguard.ahk
 
 
procguard.conf
procguard.conf
 
 
procguard.ico
procguard.ico
 
 

Repository files navigation

ProcGuard

Version

A persistent, configuration-driven process manager for Windows. It ensures a list of specified applications are always running. If a monitored process is not found, ProcGuard will automatically launch it.

It is written in AutoHotkey.

Features

  • Persistent Process Monitoring: Runs silently in the background to ensure your essential applications are always active.
  • Configuration-Driven: Manage which applications to monitor and how often using a simple .conf file.
  • Flexible Launch Commands: For each process, you can specify a simple executable name or a full command with a path and arguments.
  • Live Configuration Reload: Automatically reloads the configuration file, allowing you to change settings without restarting the script.
  • Optional Logging: Create an empty procguard.log file in the same directory to enable detailed logging of the script's actions.
  • Normal or Reverse Mode: For each entry, choose whether to run the command when the process is missing (default) or when it is present (reverse mode).
  • De-elevated Launch (user flag): Optionally launch a target at normal (Medium) integrity even when ProcGuard itself runs elevated. This keeps global hotkeys working under Windows UIPI (see De-elevated Launch).

Usage

There are no command-line arguments for now. All configuration is handled by the procguard.conf file.

  1. Configure: Create and edit the procguard.conf file in the same directory as procguard.ahk.
  2. Run: Simply execute procguard.ahk. It will run silently in the background.

Configuration (procguard.conf)

Create a text file named procguard.conf in the same directory as the executable. The script will not run without it.

  • Each line represents one process to monitor.
  • Lines starting with # are ignored as comments.

Format

The format for each line is a comma-separated list:

ProcessName.exe,PathToExecutable [with arguments],IntervalSeconds[,Flag[,Flag]]
  • ProcessName.exe: The name of the process to check for (e.g., notepad.exe).

  • PathToExecutable [with arguments]: The full command to run based on the chosen mode. This can include a full path and any command-line arguments.

  • IntervalSeconds: The number of seconds to wait between checks for this specific process.

  • Flag (optional, repeatable): Zero or more flags in any order. Supported flags:

    • reverse: reverse mode – run the command when the process is running (default is to run when it is not running).
    • user: de-elevated launch – start the target at normal (Medium) integrity via the Windows Explorer shell, even when ProcGuard runs elevated. See De-elevated Launch below.

    Any field that is not a recognized flag is ignored, so existing single-reverse configurations remain valid. Flags may be combined, e.g. ...,3600,reverse,user.

Example procguard.conf

# =======
# Follow the format below to set the configuration
# Executable binary name to be checked, path to the exe to be started, interval (seconds), optional flags
# Flags (any order, repeatable):
#   "reverse" → run when process IS running (default: run when NOT running)
#   "user"    → launch de-elevated (Medium integrity) so global hotkeys work
# =======

# Ensure GoldenDict is running, check every 10 minutes (600 seconds)
# Normal mode (default): if GoldenDict.exe is missing, start it
GoldenDict.exe,C:\Path\to\GoldenDict\GoldenDict.exe,600

# Ensure Listary is running, check every 10 minutes
Listary.exe,C:\Path\to\ListaryPortable\Listary.exe,600

# Run a command with arguments, check every 4 hours (14400 seconds)
WeaselDeployer.exe,C:\Path\to\RimeIMEPortable\weasel\WeaselDeployer.exe /sync,14400

# Keep a simple background utility active, check every minute
CoffeeBean.exe,C:\Path\to\CoffeeBean.exe,60

# Reversed behavior
# When Everything.exe IS running, execute the command every 10 minutes
Everything.exe,C:\Path\to\Everything.exe -reindex -startup,3600,reverse

# De-elevated launch: start a hotkey app at normal integrity so its global
# hotkeys keep working even though ProcGuard itself is elevated.
bageshuo.exe,C:\Path\to\bageshuo\bageshuo.exe,60,user

De-elevated Launch (user flag)

By default, a process launched by ProcGuard inherits ProcGuard's integrity level. If ProcGuard is started by an elevated parent (for example an Administrator terminal, or an elevated editor/launcher), it runs at High integrity, and so does everything it starts.

This causes a subtle problem for apps that register global hotkeys. Windows enforces UIPI (User Interface Privilege Isolation): a hotkey registered by a High-integrity process is generally blocked from firing while a normal, Medium-integrity window (your browser, editor, Explorer, etc.) has focus. The symptom is that the app works when launched by double-clicking its icon (Medium integrity) but its hotkey silently stops working when launched by ProcGuard (High integrity).

The user flag fixes this. Instead of launching the target directly, ProcGuard asks the already-running, unelevated Windows Explorer shell to launch it. The target then inherits Explorer's Medium integrity token — exactly as if you had double-clicked it — so its global hotkeys work normally.

Notes:

  • Only add user to targets that should run at normal privilege. Do not use it for tools that genuinely require Administrator rights.
  • Because the launch is delegated to Explorer, ProcGuard does not receive the child's PID; it continues to track the target by process name on its normal interval, so monitoring and restart still work.
  • If no Explorer window is available, ProcGuard falls back to a direct launch (which may run elevated) and records a warning in the log.

Building from Source

To compile the procguard.ahk script into procguard.exe, you will need the AutoHotkey compiler (Ahk2Exe), which is included with the standard AutoHotkey v1.1 installation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.