Software Power Off on Windows NT 4.0

Introduction:

Software 'Power Off' was first introduced for compliant hardware with Windows 95. Windows NT 4.0, as released by Microsoft in 1996, did not support the operation 'out of the box', except in some cases of laptop computers (with Vendor installed versions of NT - more details here).

In fact, many computers are ready to use Power Down After Shutdown but do not have the proper registry setting enabled. If this is the case for you, all that needs to be done is a minor registry adjustment. To enable the feature, open your registry with regedit.exe and navigate to the registry key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

Find the valuename 'PowerdownAfterShutdown' and change it's valuedata to '1'. If the valuename doesn't exist, you will need to add it. Alternately, if you don't feel comfortable editing the registry yourself, I've written a .reg file (ntpd.reg) to automate this process. Download it and save it somewhere convenient on your PC. Double click it to add the necessary changes to your registry.

If Power Down After Shutdown doesn't function correctly after changing the registry setting, then your computer may not be properly set up to use the feature, or may not be capable of performing this operation. Read the following sections for more detailed information:

How it Works:

Operation of the "Power Off" feature requires NT4 to have direct access to the necessary hardware on the motherboard. The problem is that the Hardware Abstraction Layer (HAL) as supplied with NT lacks the necessary code to talk to the APM (Advanced Power Management) hardware on the motherboard, and blocks direct access. A company by the name of Softex came to the rescue with a modified HAL (HAL.DLL) that adds the necessary hardware support.

How to Add 'Power Off after Shutdown' to a Desktop (and some Laptop) PC: (Full Procedure)

  1. Obtain a copy of the appropriate HAL.DLL from Softex that works with your motherboard hardware. The main variation is single or multiple processor versions. The standard single processor and multiprocessor Softex HALs are included on all NT 4.0 Service Packs from 4 upwards. You can extract them from Service Pack by using the /x switch from the command prompt.

    EG: "Drive Letter:\Path\Service Pack 6a /x" where:

  2. After the integrity of the Service Pack archive is verified, a dialogue box will appear asking for a location to where you want to store the contents of the Service Pack. Pick a convenient temporary folder. After the extraction is complete the Service Pack process will terminate. (ie: the Service Pack does not actually install anything - it just unpacks the files to the nominated folder) Look in the temporary folder and you will find a file entitled HAL.DLL.SOFTEX. The multi-processor version of the file is HALMPS.DLL.SOFTEX.
    WARNING: If your system uses a differing HAL (eg: many Dell, Compaq and Gateway PCs use an OEM supplied version) you may need to ask around on the net to find a copy suitable for your hardware - unfortunately the Softex HAL will most likely not function correctly. (see the 'Notes' section below)
  3. Copy the Softex HAL appropriate for your hardware (HAL.DLL.SOFTEX or HALMPS.DLL.SOFTEX or an OEM HAL) to your \WinNT\System32 folder.
  4. Rename the file to HAL2.DLL
  5. Open BOOT.INI on your system partition with notepad. You may need to change the attributes of BOOT.INI and remove the read-only and/or hidden and system tags to allow you to edit it.
  6. Change the entry that you normally use to boot your NT installation so that the switch /hal=hal2.dll is appended to the end. Example from my system:

  7. Restore the attributes of BOOT.INI to the same state as you originally found them, once you have saved the modified version.
  8. The registry needs to be updated to tell Windows NT that it can now use Software Power Off option. (Note: If you have previously performed this step, there is no need to do it again !) Open the registry with RegEdit and navigate to the key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.

    Find the valuename "PowerdownAfterShutdown" and change it's valuedata to "1". If the valuename doesn't exist, you will need to add it. Alternately, if you don't feel comfortable editing the registry yourself, I've written a .reg file (ntpd.reg) to automate this process. Download it and save it somewhere convenient on your PC. Double click it to add the necessary changes to your registry.

  9. Delete the folder of files extracted from Service Pack. It is probably a good idea to keep a copy of the hal2.dll file you have added to your System32 folder in case you need to rebuild the machine for any reason. Likewise, keep a copy of ntpd.reg as well.
  10. Reboot your machine and the new Software Power Off features should be available.

Notes:

Some PC hardware is incompatible with the Softex approach to powering off the machine. Possible scenarios are:
  1. The machine rebooting instead of powering off when you select 'Shutdown' as the option. (I know from experience that some Gateway and Compaq machines will demonstrate this problem. See Microsoft Knowledgebase Article 155373 - "Compaq Laptops Restart Instead of Powering Down" for the official Microsoft explanation of this problem.)
  2. The Softex HAL is totally incompatible with your hardware, and may cause a blue screen of death (STOP error) at system boot.
  3. If for any reason the Softex HAL.DLL is not used, and the Microsoft standard HAL is used instead, the symptoms of point 1 above may be exhibited on any hardware.
Some hardware manufacturers have developed alternative arrangements to achieve software power off. The general approach of these solutions is a hardware specific service or executable file added to the system and configured to run at system startup. Such methods are beyond the scope of this article.

In a "Dual-Boot" situation it is possible that the power management arrangements of the other operating system may conflict with Softex approach. See Knowledgebase Article 283378 - "You Must Hold Down the Power Button to Shut Down Windows NT 4.0 in a Dual-Boot Environment With Windows XP" for an example of this situation.

DANGERS:

  1. ONLY use the above mentioned procedure if the system has no manufacturer supplied power management system available. For details on dealing with a laptop computer, see the section "Power Management and Laptop PCs Running NT 4.0" below.
  2. I have seen instructions published previously on the net that suggest that the Softex HAL should REPLACE the existing HAL.DLL on the machine. This is an inherently dangerous method of implementing this software power off scheme for a couple of reasons:
  3. The approach of nominating a different HAL through the switch in the BOOT.INI file is the safer method of achieving the desired result for a couple of reasons:
  4. DO NOT attempt to use BIOS hardware power management features whilst running Windows NT 4.0. The BIOS power management will conflict with the operation of NT 4.0 and may result in STOP errors or other problems. See Knowledgebase article 158942 - Windows NT Hangs With BIOS Power Management Enabled for further details.

Other Power Management Options.

With suitable software additions, the computer monitor can also be power managed under NT 4.0 See here for the details of this procedure.


Power Management and Laptop PCs Running NT 4.0

The 'Software Power Off' we have been discussing above is only a small part of a much larger subject: Power Management. Two standards exist in the marketplace for the control of computer hardware for the purposes of power management: Fully implementing power management makes a great deal of sense in a laptop computer environment, since the available power from the internal battery pack of a laptop computer is fixed and limited. Any technique which can reduce power consumption will extend the machine run time. Typically power management will do things like:

The Basic Approach:

Introduction.

Microsoft officially state in Knowledgebase article '154642 - Power Management in Windows NT 4.0' that "Power management features such as Suspend are not available in Windows NT Version 4.0". Regardless of Microsoft's statement, many laptop manufacturers have created or licensed power management solutions for their hardware suitable for use with Windows NT 4.0.

The following information has to be general in nature, since the exact implementation of power management under NT4 is controlled by the specific hardware on which it is being run. Each manufacturer will provide their own (non standard) solution to achieve the desired results. In all instances (using either APM or ACPI) the same basic approach will be taken with the changes that need to be made to the NT4 installation.

A Typical Arrangement:

  1. The NTDETECT.COM will be replaced by a hardware specific version supplied by the manufacturer. At system bootup, during hardware enumeration, this modified NTDETECT will generate additional entries in the HKEY_LOCAL_MACHINE\HARDWARE registry hive detailing the locations and control mechanisms of the APM or ACPI hardware found. Typical examples of key names found will be items like 'APMHardware'. (The exact names will vary)
  2. The Hardware Abstraction Layer (HAL.DLL) will be replaced with a hardware specific version which allows NT4 to directly access hardware involved with power management on the system. (Examples: Dynamically controlling the processor clock speed and System Power Off at Shutdown)
  3. Several new drivers will be added to the system:
  4. Explorer.exe is replaced with a version containing additional 'Start Menu' commands. (eg: Standby and / or Suspend and / or Hibernate - not all options may be available in any particular implementation) The modified Explorer.exe can invoke these new modes by making calls through Laptop.sys, HAL.DLL and the hardware specific drivers.
  5. SysTray.exe is replaced with a version containing a Taskbar Applet which usually includes some sort of display showing the current system state. Typically the information presented here includes the state of charge of the battery and whether the laptop computer is running from battery pack or AC supply. There is also usually a control and configuration interface provided for power management. (eg: Settings to specify what happens when the battery reaches a discharge limit) This modified SysTray communicates through Laptop.sys and changes settings in the BIOS through the BIOS access drivers mentioned above.

WARNINGS:


Acknowledgments:

Thanks to John for additions and corrections on this page.


Back to Index

All promotional photographs and advertising material, corporate names and logos, product names, trade names, trademarks and registered trademarks are the property of their respective owners, and are acknowledged as such.
This information is maintained by ZCM Services, Australia. Whilst every care is taken in preparation, I accept no responsibility for errors or omissions. Use the information presented on this site AT YOUR OWN RISK.
Last Update April 7, 2010 at 8:40 PMAEST.