Shutdowner!

By: Andreasng






What is Shutdowner?

Shutdowner by andreasng is a lo-fi utility to aid the process of scheduling a system shutdown.

All it really does is to call native windows commands in the command prompt (cmd) (shutdown -s -f -t XXXX) which will make your system automatically shut down after XXXX seconds has passed.
The shutdown is set to "forced" - which means that if any program has unsaved data, consider it to be lost. Please save your work before you schedule the shutdown.

Use the handy dropdown menu to choose the duration of the countdown.

If a shutdown is already scheduled you can cancel it easily by pressing the "cancel shutdown" button.

All of this - just to avoid flailing around in the command prompt!


How to set up Shutdowner?

It is easy to setup. Extract the supplied zip-file whereever you like. Right-click drag and drop the .hta file onto the desktop and create a shortcut.
If you like you can change the icon of the shortcut to the supplied .ico included in the files. You can find it in the Bin folder.

Step 1: Copy shutdowner.hta to desktop


Step 2: Change the icon for aesthetics


Step 3: Choose shutdowner.ico as the icon


Step 4: Rename the shortcut to "Shutdowner"


Caution!

This utility is made using Visual Basic wrapped in a .hta file. Never download and use .hta files from untrusted sources. Check below to "peer review" the commands that is executed in the command prompt.

Peer review it!

The code responsible for the process can be seen here below. This is to allow the user to "peer review" the code and make sure that it is the same as inside of the .hta file. Please open the .hta file in Notepad++ or rename the file to .txt to check it in the defaul Notepad application available in any Windows version.

Crucial code snippets are highlighted!

Sub RunCommand()
    Dim time_selected, time_in_seconds, cmd, shell
	
    time_selected = document.getElementById("time").value
    time_in_seconds = time_selected * 60

    cmd = "cmd.exe /c shutdown -s -f -t " & time_in_seconds
    Set shell = CreateObject("WScript.Shell")
    shell.Run cmd, 1, True
End Sub

Sub RunAbort()
    cmd = "cmd.exe /c shutdown -a"
    Set shell = CreateObject("WScript.Shell")
    shell.Run cmd, 1, True
End Sub

Sub ExitCommand()
    window.close True
End Sub

Sub Window_OnLoad

    window.resizeTo 424, 176
    document.title = document.title & ",  Version " & Shutdowner.Version
	
    posX = CInt( ( window.screen.width  - document.body.offsetWidth  ) / 2 )
    posY = CInt( ( window.screen.height - document.body.offsetHeight ) / 2 )
    If posX < 0 Then posX = 0
    If posY < 0 Then posY = 0
	
    window.moveTo posX, posY

End Sub