Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: Power Button - Start Menu

09 Dec 2008   #19
Brink
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 
Power Button - Start Menu

How to Change the Default Windows 7 Start Menu Power Button Action

...

My System SpecsSystem Spec
23 Mar 2012   #20
Brink
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

Quote   Quote: Originally Posted by mandinga09 View Post
Hi All,

Is there a way to push the power button changes to multiple PCs? By that I mean, can I set the power button to "Log Off" on multiple machines with a script? We prefer to log off in our domain instead of shutdown, and it would be nice to set the 'Shut Down' button to 'Log off' on all my PCs (and all my users) in the domain without visiting each machine...

Thanks guys,

M
Hello M, and welcome to Seven Forums.

I don't use a domain, but I would think that using OPTION FIVE to set your domain policy would have it enforced on all systems when they logged in to the domain. Hopefully someone with more domain experience will post to verify.

My System SpecsSystem Spec
23 Mar 2012   #21
mandinga09

Windows 7 Ent x64 SP1 (7601)
 
 

Thanks for the quick response Brink! Unfortunately I do not have access to the GPOs for the domain (and the folks who do are clueless...) so I am forced to accomplish simple Group policy tasks with complicated scripts and deployments via SCCM. Thanks again, lets hope someone knows a way to push this fix with a script.
My System SpecsSystem Spec
23 Mar 2012   #22
kegobeer

Windows 7 Ultimate x64 SP1
 
 

If you aren't a domain admin, you won't be able to push out policy. You could write logon scripts, but unless you can assign logon scripts to individuals in AD, they would be useless. I'm not familiar with SCCM, as we don't use it on our domain. Exactly what does it allow you, as a non-domain admin, to do in the domain?
My System SpecsSystem Spec
23 Mar 2012   #23
mandinga09

Windows 7 Ent x64 SP1 (7601)
 
 

Hi keg,

I should clarify: I am a domain admin, just not with access to the DC or GPOs. We have a tiered access model, so only a few people have access to the DCs and I am not one of them. However I have access to pretty much everything else.

SCCM is a tool that allows you to push software and run reports on domain PCs from a central console. We would be dead without it; its a great tool. We use it to install software on up to 1500 PCs at once - push security updates to software, remove unapproved software, report on system hardware, deploy reg hacks... Typically when I need to deploy a fix that I can't get the GPO guys to make, I build a script and deploy it via SCCM, which will ensure 100% compliance every time. This solution is as reliable as a GPO, but more complex for sure.

M
My System SpecsSystem Spec
24 Mar 2012   #24
Dwarf

Windows 8.1 Pro RTM x64
 
 

Here is some code to deploy that should accomplish the task for you. It parses all user profiles on the computer, loads their HKCU hives and then sets the appropriate registry key.

Note that I have just provided the code, as I am not familiar with SCCM and so you will need to incorporate it into a suitable script that can be deployed. I recommend that you test it first before deploying it on a wider scale.

Code:
' ################################################
' Start of Routine
' ################################################
Option Explicit
Const ForAppending = 8
Const HKLM = &H80000002
' ################################################ 
' HKCU reference and value to be used
' ################################################ 
Const sDwordUserKey = "\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
Const sDwordUserKeyValueName = "Start_PowerButtonAction"
Const sDwordUserKeyValue = "1"
' ################################################
' Main
' ################################################
Dim oReg, oFSO, oFile, oUserSubkey, aUserProfiles, oShell
Dim sProfileLCase, sRegExe, sRegLoad, sRegUnload, sHiveName, sSubPath, sProfile, sValueName, sKeyPathUserProfiles, sValue, ReturnVal
Set oReg = GetObject("winmgmts:\\.\root\default:StdRegProv")
Set oShell = CreateObject ("WScript.Shell") 
Set oFSO = CreateObject ("Scripting.FileSystemObject")
' ################################################
' Begin configuration of existing user profiles
' ################################################
sValueName = "ProfileImagePath"
sKeyPathUserProfiles = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
sRegExe = "C:\Windows\system32\reg.exe"
oReg.EnumKey HKLM, sKeyPathUserProfiles, aUserProfiles
' ################################################
' Start of users loop
' ################################################
For Each oUserSubkey In aUserProfiles
sSubPath = sKeyPathUserProfiles & "\" & oUserSubkey
oReg.GetExpandedStringValue HKLM,sSubPath,sValueName,sValue 
sProfile = Split(sValue, "\")
sProfileLCase = LCase(sProfile(2)) 
If sProfileLCase = "system32" Then
ElseIf sProfileLCase = "localservice" Then
ElseIf sProfileLCase = "networkservice" Then
ElseIf sProfileLCase = "serviceprofiles" Then
Else
' ################################################
' Load user's profile hive into a temp location
' ################################################
sHiveName = "TempHive_" & sProfileLCase   
sRegLoad = " LOAD HKLM\" & sHiveName & " """ & sValue & "\ntuser.dat"""
oShell.Run sRegExe & sRegLoad, 0, True   
' ################################################
' Call Subroutine to change registry key
' ################################################
SetConfigUserHive (sHiveName)   
' ################################################
' Unload user's profile hive
' ################################################
sRegUnload = " UNLOAD HKLM\" & sHiveName
oShell.Run sRegExe & sRegUnload, 0, True
End If 
Next
' ################################################
' End of users loop
' ################################################
' Default User Profile
' ################################################
sHiveName = "TempHive_DefaultUser"
sRegLoad = " LOAD HKLM\" & sHiveName & " ""C:\Documents and Settings\Default User\ntuser.dat"""
oShell.Run sRegExe & sRegLoad, 0, True
' ################################################
' Call Subroutine to change registry key
' ################################################
SetConfigUserHive (sHiveName)
sRegUnload = " UNLOAD HKLM\" & sHiveName
oShell.Run sRegExe & sRegUnload, 0, True
' ################################################
' Routine exit point
' ################################################
WScript.Quit ()
' ################################################
' Subroutine to change registry key
' ################################################
Sub SetConfigUserHive (sTempHive)
Dim sTempHiveStringKeyPath, sTempHiveDwordKeyPath
' ################################################
' Path of registry key
' ################################################
sTempHiveDwordKeyPath = sTempHive & sDwordUserKey
' ################################################
' Create Dword registry key if non-existant
' ################################################
If oReg.GetDwordValue(HKLM, sTempHiveDwordKeyPath & "\", sDwordUserKeyValueName) <> 0 Then
ReturnVal = oReg.CreateKey(HKLM, sTempHiveDwordKeyPath)
End If
' ################################################  
' Create Dword value
' ################################################
ReturnVal = oReg.SetDwordValue(HKLM, sTempHiveDwordKeyPath & "\", sDwordUserKeyValueName, sDwordUserKeyValue)
End Sub
' ################################################
' End of Subroutine
' ################################################
Acknowledgements to Nick Moseley, t3chn1ck
My System SpecsSystem Spec
31 Aug 2012   #25
tperk100

Win7 Ult 64
 
 

Thanks for such good explanations, but none of these methods work for me. I can change the setting via the power button properties and it shows logoff which is what I want. If I go to the Registry, the value is 1 (log off). The policies are set for log off.
BUT the button still says "Shutdown!"

Any ideas on how to fix this?
Thanks
My System SpecsSystem Spec
31 Aug 2012   #26
Brink
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

Hello Tom, and welcome to Seven Forums.

Does your Power button with "Shut down" in the Start Menu happen to have a little shield on it as well??

If so, then this is normal and indicates that you have Windows Updates that need to be installed. Clicking on this "Shut down" button with the shield icon will have Windows 7 install the updates first then shut down. Afterwards your power button will return to what you had it set for.

If this is the case, then you could use the tutorial below to turn this off by not allowing it.

Shut Down Windows - Change "Install Updates and Shut Down" as Default

Hope this helps,
Shawn
My System SpecsSystem Spec
31 Aug 2012   #27
tperk100

Win7 Ult 64
 
 

Shawn.

You were RIGHT ON! I powered down and there were updates waiting. Now button is set to Log Off

Thanks a million!
My System SpecsSystem Spec
31 Aug 2012   #28
Brink
Microsoft MVP

64-bit Windows 8.1 Enterprise
 
 

You're most welcome Tom.
My System SpecsSystem Spec
Comment

 Power Button - Start Menu





Tutorial Tools



Similar help and support threads for2: Power Button - Start Menu
Windows 7 Tutorial Category
Power button in start menu changed to log off automatically? General Discussion
Solved Start menu power button BSOD Help and Support
Classic Start Menu: Start Button appears doubled Customization
start menu power button hide/remove how?? Customization
Start Menu - Replace Shut Down Button, with Lock Button Customization
Start Menu Power button option is missing Performance & Maintenance
Tweaking the Power Button Icon in Start Menu Customization

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 05:33 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33