Skip to content
fzambroniPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Shutdown

Shutdown is a small Windows desktop utility built with AutoIt. It lets you schedule shutdown, restart, hibernate, application close, or timer stop actions using either a fixed time or a duration countdown.

The app also includes tray support, visual and audio warnings, countdown history, a mouse keep-alive feature, multi-monitor-aware notifications, logging, and a GitHub-based self-update flow.

Current source reference: Shutdown.au3 version 4.1.2.2.


Table of contents


What it does

Shutdown is designed for situations where you want a simple, visible, and reliable timer before a Windows action happens.

Typical examples:

  • Shut down the PC at a specific time.
  • Restart after a fixed countdown.
  • Hibernate the machine after some idle work.
  • Keep the mouse active while a timer is running.
  • Receive visible and audible warnings before the final action.
  • Avoid accidentally running multiple copies of the app.

The interface is intentionally compact: action selection, time mode, hour/minute input, countdown display, progress bar, sound controls, tray option, mouse jiggler controls, and a small history list.


Main features

Scheduled actions

The app supports these timer outcomes:

Action Behavior
Shutdown Powers off the computer and force-closes applications.
Restart Restarts the computer and force-closes applications.
Hibernate Hibernates the computer.
Stop Stops the timer and keeps the computer on.
Close Closes the Shutdown application only.

Time modes

Shutdown supports two timer modes:

Mode Description
Specific Time Runs the selected action at a defined clock time. If the selected time has already passed today, it schedules the action for the next day.
Duration H:M Runs the selected action after the selected number of hours and minutes from now.

The app blocks very short timers under 15 seconds to avoid accidental immediate execution.

Countdown display

While a timer is running, the app shows:

  • Remaining time in HH:MM:SS format.
  • Progress bar based on elapsed timer percentage.
  • Tray tooltip showing the selected action and remaining time.
  • Disabled time controls to prevent accidental edits during an active countdown.

Visual warnings

During the final minute, the UI becomes more visible:

  • Last 60 seconds: countdown text pulses.
  • Last 30 seconds: the window flashes between the default Windows background and warning orange.
  • Tray icon flashes during warning periods.
  • Mouse keep-alive stops during the final 30 seconds so the user can regain control before the action executes.

Floating notification

A small topmost notification window appears during the final warning period.

It uses GDI+ rendering and appears near the active monitor's work area, instead of assuming only the primary monitor exists. This makes the warning more reliable on multi-monitor setups.

Sound alerts

The app can play embedded WAV alerts during the final countdown.

Controls include:

  • Enable or disable sound.
  • Select volume from predefined values.
  • Test the sound directly from the UI.

The sound resources are embedded into the compiled executable and extracted to the Windows temp folder at runtime.

System tray support

When Minimize to tray is enabled, minimizing the app hides the main window and keeps the tray icon available.

Tray menu options:

  • Restore
  • STOP
  • Exit

Double-clicking the tray icon also restores the main window.

Mouse keep-alive

Shutdown includes a mouse jiggler feature that can move the cursor when the mouse remains still for a configured threshold.

Available controls:

  • Enable or disable mouse jiggler.
  • Sensitivity threshold.
  • Movement speed.
  • Optional micro-jiggler / whisper mode.
  • Separate whisper sensitivity and speed.

The current implementation uses Windows virtual-screen metrics so random movement works across all monitors, including layouts with secondary monitors and negative screen coordinates.

Whisper mode

Whisper mode performs very small cursor nudges instead of larger random movement.

This mode is designed to be less visually disruptive while still generating real Windows input activity.

History list

Fixed-time entries are saved to a compact history list.

You can:

  • Click a previous time to reuse it.
  • Clear the selected history item.
  • Clear all history by pressing CLEAR with no item selected.

History is stored in the current user's registry settings.

Single-instance protection

The app checks for an already-running copy of itself. If a second copy is launched, it shows a warning and exits.


Screens and behavior

The main window includes:

  • Action selection: Shutdown, Restart, Hibernate, Stop, Close
  • Mode selection: Specific Time or Duration H:M
  • Hour and minute fields
  • START / STOP button
  • Large countdown display
  • Progress bar
  • Sound controls
  • Tray option
  • Mouse jiggler controls
  • History list
  • Version status bar

The app uses the current Windows dialog background color to stay visually aligned with the active Windows theme.


Installation

Option 1: Use the compiled release

  1. Download the latest shutdown.exe from the repository release or distribution package.

  2. Place it in any local folder, for example:

    .\Shutdown\
    
  3. Run:

    .\Shutdown\shutdown.exe
    

No installer is required.

Option 2: Build from source

See Build from source.


How to use

  1. Open shutdown.exe.
  2. Select the desired action:
    • Shutdown
    • Restart
    • Hibernate
    • Stop
    • Close
  3. Choose a mode:
    • Specific Time for a clock time.
    • Duration H:M for a countdown duration.
  4. Select hour and minute.
  5. Optional: enable sound alerts.
  6. Optional: enable minimize-to-tray.
  7. Optional: enable mouse jiggler or whisper mode.
  8. Click START.

To cancel an active timer, click STOP or use the tray menu.


Configuration

Runtime settings

Most user preferences are stored under the current user's Windows registry:

HKEY_CURRENT_USER\Software\ShutdownPRJ\

Stored values include:

Setting Purpose
TimeMode Saves selected time mode.
Hour Saves selected hour.
Minute Saves selected minute.
Sound Saves sound enabled/disabled state.
Volume_Set Saves alert volume.
TrayCheck Saves minimize-to-tray preference.
MouseMove Saves mouse jiggler enabled/disabled state.
MouseSensitivity Saves mouse jiggler sensitivity.
MouseSpeed Saves mouse jiggler speed.
Whisper Saves whisper mode enabled/disabled state.
MouseWhisper Saves whisper movement size.
MouseWhisperSpeed Saves whisper movement speed.
History Saves fixed-time history entries.
Radio_Shutdown Saves action selection state.
Radio_Restart Saves action selection state.
Radio_Hibernate Saves action selection state.
Radio_StopTimer Saves action selection state.
Radio_Close Saves action selection state.

To reset all app preferences, close the application and remove the registry key:

reg delete HKCU\Software\ShutdownPRJ /f

settings.ini

The updater and verbose logging use settings.ini in the same folder as the executable.

Example:

[Update]
source=github
github_raw_base=https://raw.githubusercontent.com/<github-user>/Shutdown/main
published_exe=shutdown.exe

[Logging]
VerboseMode=0

Recommended defaults:

Key Recommended value Notes
source github Documents that updates come from GitHub.
github_raw_base Raw GitHub URL for the target branch Must point to the folder where version.txt and shutdown.exe are published.
published_exe shutdown.exe Keep lowercase. GitHub raw URLs are case-sensitive.
VerboseMode 0 Use 1 only while troubleshooting.

Auto-update

Shutdown includes a GitHub-based update flow.

At startup, when running as a compiled .exe, the app checks the remote version.txt file and compares it with the local executable version.

Auto-update is skipped when running the .au3 file directly from SciTE or development mode. This prevents the development source run from trying to replace itself.

Expected published files

The GitHub branch used for updates should contain:

version.txt
shutdown.exe

version.txt must contain only the version number, for example:

4.1.2.2

No extra text, comments, or labels should be added to version.txt.

Update flow

  1. shutdown.exe starts.

  2. The app reads the local executable version using FileGetVersion().

  3. The app downloads remote version.txt.

  4. If the remote version is not newer, nothing happens.

  5. If the remote version is newer, the app downloads the published executable.

  6. The downloaded executable version is validated.

  7. The downloaded file is staged as:

    .\shutdown.tmp
    
  8. Updater.exe is extracted/prepared.

  9. Updater.exe is launched.

  10. The main app exits.

  11. Updater.exe replaces:

.\shutdown.exe
  1. The updated app is restarted.

Important update rules

  • The published executable should be named shutdown.exe.
  • Keep the casing consistent. Shutdown.exe and shutdown.exe are not equivalent in GitHub raw URLs.
  • The version embedded in shutdown.exe must be newer than the local installed version.
  • version.txt must match the version you intend to publish.
  • Publish the executable and version.txt together.
  • Do not update version.txt before the new executable is available, or clients may detect an update that cannot be installed.

Logs

Main application logs

The main app writes logs under:

.\log\

Example filename pattern:

Shutdown_YYYYMMDD_HHMMSS_COMPUTER_USER.log

Updater logs

When verbose mode is enabled, the updater writes logs under:

.\log_Updater\

Verbose logging is controlled by:

[Logging]
VerboseMode=1

Use verbose logging only while diagnosing issues. It creates more detailed log files and is usually unnecessary for normal use.


Build from source

Requirements

  • Windows 10 or Windows 11.
  • AutoIt 3.
  • SciTE4AutoIt3 recommended.
  • AutoIt3Wrapper available in the AutoIt/SciTE toolchain.

Source files

A complete build expects these files in the project folder:

.\Shutdown\
├─ Shutdown.au3
├─ Updater_lib.au3
├─ Updater.au3
├─ FileUpdate.au3
├─ settings.ini
├─ shutdown.ico
├─ beep-01a.wav
├─ beep-07.wav
└─ splash.jpg

Generated files may include:

.\Shutdown\shutdown.exe
.\Shutdown\Updater.exe
.\Shutdown\FileUpdate.exe
.\Shutdown\version.txt
.\Shutdown\shutdown.tmp
.\Shutdown\log\
.\Shutdown\log_Updater\

Recommended wrapper paths

Use relative project paths in AutoIt3Wrapper directives.

Example:

#AutoIt3Wrapper_Res_File_Add=.\shutdown.ico
#AutoIt3Wrapper_Res_File_Add=.\beep-01a.wav
#AutoIt3Wrapper_Res_File_Add=.\beep-07.wav
#AutoIt3Wrapper_Res_File_Add=.\Updater.exe
#AutoIt3Wrapper_Run_After=.\FileUpdate.exe

This keeps the project portable and avoids embedding local machine-specific folders in the repository documentation.

Compile order

Build in this order:

  1. Compile Updater.au3 to generate:

    .\Updater.exe
    
  2. Compile FileUpdate.au3 to generate:

    .\FileUpdate.exe
    
  3. Compile Shutdown.au3 to generate:

    .\shutdown.exe
    
  4. Run FileUpdate.exe if your wrapper did not run it automatically. This creates or updates:

    .\version.txt
    

The final publishable files are usually:

shutdown.exe
version.txt
settings.ini

Depending on your distribution style, you may also include documentation, source files, and resources.


Repository layout

Recommended repository structure:

.\Shutdown\
├─ README.md
├─ Shutdown.au3
├─ Updater_lib.au3
├─ Updater.au3
├─ FileUpdate.au3
├─ settings.ini
├─ shutdown.ico
├─ beep-01a.wav
├─ beep-07.wav
├─ splash.jpg
├─ shutdown.exe
└─ version.txt

Recommended ignored/generated items:

log/
log_Updater/
*.tmp
*_github_version.txt
*_github_latest.exe

You may choose whether to commit compiled .exe files. For the current self-update design, the published update branch must expose shutdown.exe and version.txt through a raw GitHub URL.


Development workflow

A typical release workflow:

  1. Update Shutdown.au3.
  2. Increment the wrapper file/product version.
  3. Compile Updater.au3 if the updater changed.
  4. Compile FileUpdate.au3 if the version-file generator changed.
  5. Compile Shutdown.au3.
  6. Generate or refresh version.txt.
  7. Confirm that version.txt contains only the target version number.
  8. Publish shutdown.exe and version.txt to the configured GitHub branch.
  9. Test update from an older installed version.
  10. Review logs if the update does not trigger.

Versioning

The app version is embedded through AutoIt3Wrapper metadata:

#AutoIt3Wrapper_Res_Fileversion=4.1.2.2
#AutoIt3Wrapper_Res_ProductVersion=4.1.2.2

The auto-update logic compares numeric version segments.

Examples:

Local Remote Result
4.1.2.1 4.1.2.2 Update available.
4.1.2.2 4.1.2.2 No update required.
4.1.2.3 4.1.2.2 No update required.

Troubleshooting

Auto-update does not run

Check these first:

  • Are you running the compiled .exe? Auto-update is skipped when running .au3 directly.
  • Is the remote version in version.txt newer than the local executable version?
  • Does version.txt contain only a version number?
  • Is github_raw_base pointing to the correct raw GitHub folder?
  • Is the published executable named exactly shutdown.exe?

Update says no update is required

This usually means the local version is equal to or newer than version.txt.

Check the local version shown in the status bar and compare it with the remote version.txt.

Executable download fails

Common causes:

  • Wrong branch in github_raw_base.
  • Wrong repository path.
  • File not committed or not available in the target branch.
  • File name casing mismatch, such as Shutdown.exe vs shutdown.exe.
  • Network, proxy, or security software blocking the download.

Downloaded executable is rejected

The updater validates the downloaded executable version.

This can fail if:

  • version.txt was updated before publishing the matching executable.
  • The compiled executable still has an older wrapper version.
  • The downloaded file is not the expected executable.

Update stages but does not replace the app

Check:

.\log_Updater\

Possible causes:

  • The main app did not exit quickly enough.
  • The executable is locked by another process.
  • The folder requires elevated permissions.
  • Security software blocked file replacement.

Timer does not start

The app blocks timers with less than 15 seconds remaining.

For Specific Time, if the selected time already passed today, the app schedules it for tomorrow.

Sound does not play

Check:

  • Play Sound is checked.
  • Volume is greater than zero.
  • The embedded WAV resources are present during build.
  • Windows is not muted.

Mouse jiggler behaves unexpectedly

The app reads virtual-screen metrics at startup.

If monitor layout changes while the app is already open, restart the app so it can reload the monitor geometry.

Multiple instance warning appears

Only one instance is allowed. Close the existing app or restore it from the system tray.


Safety notes

Shutdown and restart actions use force behavior. Save your work before starting a timer.

Hibernate requires hibernation to be enabled in Windows.

Mouse keep-alive features should be used responsibly and only where allowed by your organization or environment.

Auto-update downloads and replaces an executable from the configured GitHub raw URL. Only use trusted repositories and branches.


License

Copyright © 2026 Fabricio Zambroni.

No explicit open-source license is included in this README. If this repository is intended for public reuse, add a LICENSE file and update this section accordingly.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages