Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 10-03-2013, 07:23 AM   #1
Fully Optimized
 
jmacavali's Avatar
 
Join Date: Jun 2009
Posts: 4,867
Default Script help

I'm looking for a script of some kind that I can run on a many laptops that will set the default function for when you close the lid. I want it to "do nothing". I want it also to set the function for all users.

I don't know if it exists or if it's possible but if anyone has any insight that would be great! Thanks!
__________________

__________________
****************************************
Don't take life too seriously -- no one gets out alive. Plus, who wants to arrive to the hereafter in pristine condition wearing a suit and tie?
I want to slide in sideways, worn out, used up, hair a mess, clothes tattered, & screaming, "Whooo! What a ride!"
****************************************
jmacavali is offline   Reply With Quote
Old 10-03-2013, 09:56 AM   #2
..m.0,0.m..
Site Team
 
iPwn's Avatar
 
Join Date: May 2010
Location: USA
Posts: 3,870
Default Re: Script help

Assuming these are all Win 7 laptops...

Code:
powercfg /SETACTIVE 381b4222-f694-41f0-9685-ff5bb260df2e
powercfg /SETACVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
powercfg /SETDCVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
The first line is going to set the Power Scheme to the default "Balanced" scheme. Then it will modify the lid close action for both Plugged and unplugged to do nothing on lid close.

Put in notepad and save as "something.bat"
Execute on each laptop

EDIT: Re: All Users
Is this in a Microsoft domain environment?
__________________

__________________
Me: You'd think as the dominant species we wouldn't be so effing stupid.
J: We're just intelligent enough to be completely effing stupid.
iPwn is offline   Reply With Quote
Old 10-04-2013, 10:44 AM   #3
Fully Optimized
 
jmacavali's Avatar
 
Join Date: Jun 2009
Posts: 4,867
Default Re: Script help

Yes it's a domain. However, I run several other bat files as soon as I finish imaging computers anyway so it's not the end of the world to go ahead and run this one too. Works perfect. Thanks so much for your help! I looked all over the internet to try to find something.

Got one handy for XP by chance?
__________________
****************************************
Don't take life too seriously -- no one gets out alive. Plus, who wants to arrive to the hereafter in pristine condition wearing a suit and tie?
I want to slide in sideways, worn out, used up, hair a mess, clothes tattered, & screaming, "Whooo! What a ride!"
****************************************
jmacavali is offline   Reply With Quote
Old 10-04-2013, 11:12 AM   #4
..m.0,0.m..
Site Team
 
iPwn's Avatar
 
Join Date: May 2010
Location: USA
Posts: 3,870
Default Re: Script help

The difference between XP and the Windows Kernel of Vista and up is that with XP, you call the power scheme's and guid/sub_guids by alias. In the example above, Windows 7 requires that you gather the actual GUID first (using "powercfg /q | more") and then call them by the GUID value. With Windows XP, you can use the exact same syntax above, but substitute the GUID's for their Alias'.

Example:
Code:
powercfg /SETACTIVE SCHEME_BALANCED
powercfg /SETACVALUEINDEX SCHEME_BALANCED SUB_BUTTONS LIDACTION 0
powercfg /SETDCVALUEINDEX SCHEME_BALANCED SUB_BUTTONS LIDACTION 0
Will produce the same result
__________________
Me: You'd think as the dominant species we wouldn't be so effing stupid.
J: We're just intelligent enough to be completely effing stupid.
iPwn is offline   Reply With Quote
Old 10-04-2013, 11:59 AM   #5
Fully Optimized
 
jmacavali's Avatar
 
Join Date: Jun 2009
Posts: 4,867
Default Re: Script help

Once again, you are the man. I should have come here first, but I did learn enough in my searches to understand what you are saying, where before my hour of looking I would have had no clue what you were talking about. Thanks so much!
__________________
****************************************
Don't take life too seriously -- no one gets out alive. Plus, who wants to arrive to the hereafter in pristine condition wearing a suit and tie?
I want to slide in sideways, worn out, used up, hair a mess, clothes tattered, & screaming, "Whooo! What a ride!"
****************************************
jmacavali is offline   Reply With Quote
Old 10-09-2013, 11:13 AM   #6
Fully Optimized
 
jmacavali's Avatar
 
Join Date: Jun 2009
Posts: 4,867
Default Re: Script help

Ok, now here's a new one.

On XP I had a script that would remove the username from the registry so that when I froze the computers, it would have a blank username (and my username woud be removed). I'd like to do the same thing on Win7. Any thoughts?
__________________
****************************************
Don't take life too seriously -- no one gets out alive. Plus, who wants to arrive to the hereafter in pristine condition wearing a suit and tie?
I want to slide in sideways, worn out, used up, hair a mess, clothes tattered, & screaming, "Whooo! What a ride!"
****************************************
jmacavali is offline   Reply With Quote
Old 10-09-2013, 12:57 PM   #7
..m.0,0.m..
Site Team
 
iPwn's Avatar
 
Join Date: May 2010
Location: USA
Posts: 3,870
Default Re: Script help

Save as a .reg file

Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"DontDisplayLockedUserId"=dword:00000003
__________________
Me: You'd think as the dominant species we wouldn't be so effing stupid.
J: We're just intelligent enough to be completely effing stupid.
iPwn is offline   Reply With Quote
Old 10-10-2013, 07:49 AM   #8
Fully Optimized
 
jmacavali's Avatar
 
Join Date: Jun 2009
Posts: 4,867
Default Re: Script help

I notice it says "DontDisplayLockedUserId". Will this also remove the username if I resart the computer? That's how my XP one worked. I'm going to try it now and will let you know if it does what I need. Thanks so much for your help.
__________________
****************************************
Don't take life too seriously -- no one gets out alive. Plus, who wants to arrive to the hereafter in pristine condition wearing a suit and tie?
I want to slide in sideways, worn out, used up, hair a mess, clothes tattered, & screaming, "Whooo! What a ride!"
****************************************
jmacavali is offline   Reply With Quote
Old 10-10-2013, 09:40 AM   #9
Fully Optimized
 
jmacavali's Avatar
 
Join Date: Jun 2009
Posts: 4,867
Default Re: Script help

That did not work. It does not remove the username so that when the computer is restarted the username is blank. Any other ideas?
__________________
****************************************
Don't take life too seriously -- no one gets out alive. Plus, who wants to arrive to the hereafter in pristine condition wearing a suit and tie?
I want to slide in sideways, worn out, used up, hair a mess, clothes tattered, & screaming, "Whooo! What a ride!"
****************************************
jmacavali is offline   Reply With Quote
Old 10-10-2013, 09:59 AM   #10
..m.0,0.m..
Site Team
 
iPwn's Avatar
 
Join Date: May 2010
Location: USA
Posts: 3,870
Default Re: Script help

Append to bottom of .reg

Code:
"DontDisplayLastUserName"=dword:00000001
__________________

__________________
Me: You'd think as the dominant species we wouldn't be so effing stupid.
J: We're just intelligent enough to be completely effing stupid.
iPwn is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 07:48 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0