I am thinking about how to get rid of the start menu opening up every time I wake the computer from sleep. I am unaware of a current system option to do this. I have read if you restart from the command prompt, the menu will not appear.
Has anyone made a batch file to run that would do the shutdown to sleep to accomplish this? If so, what would the command be, and are there any other steps, like granting permissions that would be necessary?
TIA
I am thinking about how to get rid of the start menu opening up every
time I wake the computer from sleep. I am unaware of a current system
option to do this. I have read if you restart from the command prompt,
the menu will not appear.
Has anyone made a batch file to run that would do the shutdown to sleep
to accomplish this? If so, what would the command be, and are there any other steps, like granting permissions that would be necessary?
On 9/24/2023 10:49 PM, sticks wrote:
I am thinking about how to get rid of the start menu opening up every time I wake the computer from sleep. I am unaware of a current system option to do this. I have read if you restart from the command prompt, the menu will not appear.
Has anyone made a batch file to run that would do the shutdown to sleep to accomplish this? If so, what would the command be, and are there any other steps, like granting permissions that would be necessary?
TIA
https://www.thewindowsclub.com/windows-10-start-menu-always-opening-up
"if you used Power Options > Restart, which is present in the Start Menu,
your Start Menu would have been open before your computer went to Sleep
and so it would remain open after you came back to your desktop after Sleep."
Try clicking the desktop, press Alt-F4 and use the shutdown menu to select Sleep.
Paul
On 9/24/2023 11:18 PM, Paul wrote:
On 9/24/2023 10:49 PM, sticks wrote:
I am thinking about how to get rid of the start menu opening up every
time I wake the computer from sleep. I am unaware of a current
system option to do this. I have read if you restart from the command
prompt, the menu will not appear.
Has anyone made a batch file to run that would do the shutdown to
sleep to accomplish this? If so, what would the command be, and are
there any other steps, like granting permissions that would be
necessary?
TIA
https://www.thewindowsclub.com/windows-10-start-menu-always-opening-up
"if you used Power Options > Restart, which is present in the
Start Menu,
your Start Menu would have been open before your computer went to >> Sleep
and so it would remain open after you came back to your desktop
after Sleep."
Try clicking the desktop, press Alt-F4 and use the shutdown menu to
select Sleep.
Paul
Thanks. Both of those options work. I'll experiment later with a batch
to make it simpler and see if it can be done that way.
On 9/25/2023 10:22 AM, sticks wrote:
On 9/24/2023 11:18 PM, Paul wrote:
On 9/24/2023 10:49 PM, sticks wrote:
I am thinking about how to get rid of the start menu opening up every time I wake the computer from sleep. I am unaware of a current system option to do this. I have read if you restart from the command prompt, the menu will not appear.
Has anyone made a batch file to run that would do the shutdown to sleep to accomplish this? If so, what would the command be, and are there any other steps, like granting permissions that would be necessary?
TIA
https://www.thewindowsclub.com/windows-10-start-menu-always-opening-up
"if you used Power Options > Restart, which is present in the Start Menu,
your Start Menu would have been open before your computer went to Sleep
and so it would remain open after you came back to your desktop after Sleep."
Try clicking the desktop, press Alt-F4 and use the shutdown menu to select Sleep.
Paul
Thanks. Both of those options work. I'll experiment later with a batch to make it simpler and see if it can be done that way.
OK. The batch file does what I want. Wakes up without the start menu opening. One more step, though.
------------
@echo off
:home
cls
Rundll32.exe Powrprof.dll,SetSuspendState Sleep
------------
I placed the bat in my documents and sent a shortcut to the desktop.
Gave it administrator privileges
Renamed to "Sleep"
Changed icon.
This worked but you still had to go through the popup from User Account Control asking if you wanted to allow Windows Command Prompt Processor to make changes.
To get rid of this I went to the Control Panel/User Accounts/Change User Accounts Control Settings, and dropped the slider all the way to the bottom "Never Notify".
If you want to do this but don't want to change the control settings, the other two options above are almost as easy. Just a few more keystrokes or mouse clicks.
On 9/25/2023 3:53 PM, sticks wrote:
On 9/25/2023 10:22 AM, sticks wrote:
On 9/24/2023 11:18 PM, Paul wrote:
On 9/24/2023 10:49 PM, sticks wrote:
I am thinking about how to get rid of the start menu opening up every time I wake the computer from sleep. I am unaware of a current system option to do this. I have read if you restart from the command prompt, the menu will not appear.
Has anyone made a batch file to run that would do the shutdown to sleep to accomplish this? If so, what would the command be, and are there any other steps, like granting permissions that would be necessary?
TIA
https://www.thewindowsclub.com/windows-10-start-menu-always-opening-up >>>>
"if you used Power Options > Restart, which is present in the Start Menu,
your Start Menu would have been open before your computer went to Sleep
and so it would remain open after you came back to your desktop after Sleep."
Try clicking the desktop, press Alt-F4 and use the shutdown menu to select Sleep.
Paul
Thanks. Both of those options work. I'll experiment later with a batch to make it simpler and see if it can be done that way.
OK. The batch file does what I want. Wakes up without the start menu opening. One more step, though.
------------
@echo off
:home
cls
Rundll32.exe Powrprof.dll,SetSuspendState Sleep
------------
I placed the bat in my documents and sent a shortcut to the desktop.
Gave it administrator privileges
Renamed to "Sleep"
Changed icon.
This worked but you still had to go through the popup from User Account Control asking if you wanted to allow Windows Command Prompt Processor to make changes.
To get rid of this I went to the Control Panel/User Accounts/Change User Accounts Control Settings, and dropped the slider all the way to the bottom "Never Notify".
If you want to do this but don't want to change the control settings, the other two options above are almost as easy. Just a few more keystrokes or mouse clicks.
whoami /user /priv # This command, gives privilege level.
# If you have five privileges, you're unelevated
# If you have somewhere around eighteen privileges, you're likely an elevated admin group member
When you click on a .bat file, you are likely launching it as unelevated admin group member.
And you aren't really elevated. If you launch from the scheduled tasks, that launches
items as SYSTEM account.
This command allows you to run things as SYSTEM account.
Similar to how the Task Scheduler runs things (as SYSTEM).
On Windows 11, this worked once for me, then stopped.
Maybe it will help you on Win10, but the similarity of the
two OSes, and the changes pushed out, who knows. The Sysinternals
stuff used to work just fine, at one time, but it's fun to break
things, for those 7000 staff.
https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
psexec -hsi cmd <=== 32 bit OS, opens SYSTEM cmd.exe window
psexec64 -hsi cmd <=== 64 bit OS, opens SYSTEM cmd.exe window
*******
After testing this stuff, I found this one works whether Hibernation
is enabled or disabled. One of the other Sleep methods, gets tangled
in Hibernation, and then the script to go to Sleep ends up a silly
piece of crap.
So this is the winner so far. Put this in your script.
https://www.nirsoft.net/utils/nircmd.html # Downloads are at the bottom of each page
nircmd standby # sleep S3
I don't normally use Sleep, and I am annoyed to discover my mouse is set
to wake the computer, and the mouse buttons don't do anything. I had to
use the power button on the front (momentary press is enough), as that
always works for sleep. Whereas other "wakers" can be "flaky".
I tested with hibernation on and off, and it slept properly for both,
without doing a hybrid sleep on me and burning up SSD. I ran the
command from an unelevated terminal window.
Maybe that will work for your script.
The rundll32 is apparently only valid for library calls of type VOID,
and does not tolerate things returned on the stack. Consequently, the invocation you were trying, causes stack corruption. (Not that it matters)
There is also a powershell script for invoking sleep. Maybe four or five lines.
I didn't bother pasting this in, as the nircmd looks like a winner.
Paul
On 9/25/2023 10:27 PM, Paul wrote:
I guess I am a little confused as to the benefit of doing it with
nirsoft. Are you saying installing the utility and using their script
will do the same thing, but not require the User Account Control
Settings to be lowered? It just does the shutdown without asking for anything?
sticks <wolverine01@charter.net> wrote:
On 9/25/2023 10:27 PM, Paul wrote:
[Lots deleted.]
I guess I am a little confused as to the benefit of doing it with
nirsoft. Are you saying installing the utility and using their script
will do the same thing, but not require the User Account Control
Settings to be lowered? It just does the shutdown without asking for
anything?
In short: Yes and yes.
Long: 'nircmd standby' indeed does not trigger a UAC popup. And yes,
it just does the *sleep* (not "shutdown") without asking for anything.
See my response (Earlier than Paul's. Didn't you see it?) and note the part about it maybe not working in Windows 11 ('Hybrid sleep').
sticks <wolverine01@charter.net> wrote:
On 9/25/2023 10:27 PM, Paul wrote:
[Lots deleted.]
I guess I am a little confused as to the benefit of doing it with
nirsoft. Are you saying installing the utility and using their script
will do the same thing, but not require the User Account Control
Settings to be lowered? It just does the shutdown without asking for
anything?
In short: Yes and yes.
Long: 'nircmd standby' indeed does not trigger a UAC popup. And yes,
it just does the *sleep* (not "shutdown") without asking for anything.
See my response (Earlier than Paul's. Didn't you see it?) and note the
part about it maybe not working in Windows 11 ('Hybrid sleep').
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 297 |
Nodes: | 16 (2 / 14) |
Uptime: | 09:28:40 |
Calls: | 6,666 |
Files: | 12,213 |
Messages: | 5,336,272 |