How to Build a Script or Batch to Change “When I close the lid of my portable computer” Setting in Windows XP

By | January 16, 2011
Share

I build all of my Core images in Virtual Machine environments.  There are many benefits of doing this, which I’ll leave for another article.  However, some cons exist; such as the ability to change settings only related to portable computers in the core image prior to capture.  Due to this limitation, I need to set this setting Post-Image.  Unfortunately, Windows XP’s “powercfg.exe” built-in utility does not have this setting available.  I found a great 3rd party, which works flawlessly and runs silent.

image

URL: https://panaconsulting.egnyte.com/h-s/20111107/6dc07a5da5c74062
Includes: “Disable Standby.exe” AND “Enable Standby.exe”

Due to the Advanced setting being tied to each User account,  the application must be run by the End User to apply the setting.  To force this action, I added a call to the application in the “Default User”’s StartUp Folder.  See files used below:

EnableStandbySetup.bat

copy “%~dp0Enable Standby.exe” “%TEMP%\Enable Standby.exe”
copy “%~dp0EnableStandby.bat” “C:\Documents and Settings\Default User\Start Menu\Programs\Startup\EnableStandby.bat”
start /w “Enable Standby” “%TEMP%\Enable Standby.exe”

EnableStandby.bat

start /w “Enable Standby on Lid Close” “%TEMP%\Enable Standby.exe”
del “%~dp0EnableStandby.bat” /q

Note: “Enable Standby.exe” can be replaced with “Disable Standby.exe” to perform that desired.

2 thoughts on “How to Build a Script or Batch to Change “When I close the lid of my portable computer” Setting in Windows XP

Leave a Reply

Your email address will not be published.

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.