A Windows desktop utility to schedule automatic Shutdown, Restart, Log Off, Lock, Sleep Mode, or Alarm actions on your PC with a configurable countdown timer.
Built with C# and Windows Forms targeting .NET 8.0. Publishes as a single .exe file.
- 6 Power Actions — Shutdown, Restart, Log Off, Lock, Sleep Mode, Set Alarm
- Configurable Timer — Set hours (0–23), minutes (0–59), and seconds (0–59)
- Force Close Option — Optionally force-close applications when shutting down, restarting, or logging off
- Timer Controls — Pause, Resume, and Cancel the countdown at any time
- System Tray — Minimizes to the system tray; double-click the tray icon to restore
- Dark Theme — Modern dark UI with color-coded action buttons
- OS: Windows 10 / 11
- Runtime: .NET 8.0 Desktop Runtime
Download the latest AutoPcShutdown.exe from the Releases page.
git clone https://github.com/ataberkus/AutoPcShutdown.git
cd AutoPcShutdown
dotnet builddotnet publish -c ReleaseProduces a single AutoPcShutdown.exe (~170 KB) at:
AutoPcShutdown/bin/Release/net8.0-windows/win-x64/publish/
Requires .NET 8 Desktop Runtime on the target machine. Windows automatically prompts to install it if missing.
- Set the desired countdown time using the Hour, Minute, and Second dropdowns.
- Check or uncheck Force close apps (checked by default).
- Click one of the six action buttons to start the countdown.
- Use Pause, Resume, or Cancel to control the timer.
- When the timer reaches zero, the selected action executes automatically.
| Button | What it does |
|---|---|
| Shutdown | shutdown.exe /s /t 0 [/f] |
| Restart | shutdown.exe /r /t 0 [/f] |
| Log Off | shutdown.exe /l [/f] |
| Lock | rundll32.exe user32.dll,LockWorkStation |
| Sleep Mode | Application.SetSuspendState(PowerState.Suspend) |
| Set Alarm | Plays a system sound and shows a "Time is up!" message |
AutoPcShutdown/
├── AutoPcShutdown.sln
├── .gitignore
├── README.md
└── AutoPcShutdown/
├── AutoPcShutdown.csproj
├── Program.cs
├── MainForm.cs
└── MainForm.Designer.cs
This project is open source. Feel free to use, modify, and distribute.