Skip to content

Repository files navigation

Shutdown Timer Pro

A sleek, lightweight Windows utility to schedule a Shutdown, Restart, Sleep, or Lock — exactly when you want it.

Platform Framework Language UI License

Overview

Shutdown Timer Pro is a small WPF desktop app that lets you queue up a power action Shutdown, Restart, Sleep, or Lock to run after a countdown or at a specific date and time. It's built for everyday situations: downloading a large file overnight, letting a long render finish unattended, or simply enforcing your own screen-time limit. The scheduled task survives app restarts (it's saved to the registry and the app can auto-launch on login), runs quietly from the system tray, and can optionally warn you with a desktop reminder and sound before it fires.

Features

  • Four power actions — Shutdown, Restart, Sleep, or Lock the workstation.
  • Two scheduling modes
    • Timer mode — countdown by hours and minutes (e.g. "in 2h 30m").
    • Exact time mode — pick a specific date and clock time.
  • Reminders & sound — an optional desktop notification a few minutes before the action triggers, with an optional audible alert.
  • Force execution — skip the "save your work" prompts and close stubborn apps that would otherwise block the action.
  • System tray integration — minimizes to the tray and keeps running quietly in the background.
  • Task persistence — the scheduled task is stored in the Windows registry, so closing the app (or a reboot) doesn't cancel it; the app re-launches on login to keep the countdown alive.
  • Light & dark themes — a modern, borderless window with a built-in theme toggle, including live re-coloring of the visual tree.
  • Reliable power control — uses native Win32 APIs (user32.dll, advapi32.dll) with proper shutdown-privilege elevation, falling back to the built-in shutdown.exe command if the native call doesn't succeed.

Screenshots

Shutdown Timer Pro 1 Shutdown Timer Pro 2

Getting Started

Prerequisites

  • Windows 7 SP1 or later (Windows 10/11 recommended)
  • .NET Framework 4.8 (typically pre-installed on modern Windows)
  • Visual Studio 2019/2022 with the .NET desktop development workload (only required to build from source)

Build from source

  1. Clone the repository:
    git clone https://github.com/xecvas/ShutdownTimer.git
    cd ShutdownTimer
  2. Open ShutdownTimer.sln in Visual Studio.
  3. Build the solution (Ctrl+Shift+B) or publish a Release build.
  4. Run Shutdown Timer.exe from bin/Release (or bin/Debug).

Download a release

Alternatively, download the latest pre-built executable from the Releases page and run Shutdown Timer.exe directly — no installation required.

Usage

  1. Select an action — Shutdown, Restart, Sleep, or Lock.
  2. Set the time
    • Use the Timer tab for a countdown (hours and minutes), or
    • Use the Exact Time tab to pick a specific date and time.
  3. Choose options (optional)
    • Force — close apps without waiting for confirmation.
    • Reminder — get a heads-up a few minutes before the action runs.
    • Sound — pair the reminder with an audible beep.
  4. Click Start — the app drops into the system tray and waits for the scheduled time. Closing the window does not cancel the task.
  5. Changed your mind? Open the app from the tray icon and click Cancel Task.

Project Structure

Shutdown Timer/
├── Models/
│   └── Models.cs              # PowerAction, AppTheme enums and ScheduleSettings
├── Utilities/
│   ├── PowerManager.cs        # Win32 interop for shutdown/restart/sleep/lock + fallback
│   ├── RegistryService.cs     # Task & theme persistence, auto-start registration
│   └── ThemeHelper.cs         # Light/dark theme application across the visual tree
├── assets/                    # Icon and image resources
├── App.xaml / App.xaml.cs     # Application entry point
└── MainWindow.xaml / .xaml.cs # Main UI, scheduling logic, and tray behavior

Built With

  • Framework: C# / WPF (Windows Presentation Foundation) on .NET Framework 4.8
  • UI styling: Custom XAML resource dictionaries for a clean, borderless window with light/dark theming
  • System integration: Native Windows API calls (user32.dll, advapi32.dll) for power state transitions and shutdown-privilege elevation, with a shutdown.exe fallback path
  • Persistence: Windows Registry (HKCU) stores the pending task, theme preference, and the auto-start entry under Run

Contributing

Contributions are welcome! If you'd like to contribute:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/my-feature).
  3. Commit your changes (git commit -m "Add my feature").
  4. Push to the branch (git push origin feature/my-feature).
  5. Open a Pull Request.

Please keep changes consistent with the existing .NET Framework 4.8 / WPF target and avoid introducing dependencies on newer .NET runtimes.

License

This project is licensed under the terms found in LICENSE.txt.

Author

Created with ❤️ by xecvas

About

A sleek, lightweight Windows utility to schedule a Shutdown, Restart, Sleep, or Lock — exactly when you want it.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages