• Eliminating the start menu when waking

    From sticks@21:1/5 to All on Sun Sep 24 21:49:01 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to sticks on Mon Sep 25 00:18:01 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Slootweg@21:1/5 to sticks on Mon Sep 25 15:49:43 2023
    sticks <wolverine01@charter.net> 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?

    On my wife's system, I use NirSoft's 'ndircmd' with the 'standby'
    option, to initiate a Sleep.

    I put '<path>\ndircmd.exe standby' as the 'Target' of a shortcut,
    change the icon of the shortcut to a power button and put the shortcut
    on the Taskbar, so it can be easily clicked.

    Bad news: This probably won't work on a Windows 11 system, because
    those systems often have 'Hybrid sleep' instead of old-style sleep and 'ndircmd.exe standby' will probably do a hibernate on those systems (it
    does no mine).

    HTH.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From sticks@21:1/5 to Paul on Mon Sep 25 10:22:11 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From sticks@21:1/5 to sticks on Mon Sep 25 14:53:40 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to sticks on Mon Sep 25 23:27:19 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From sticks@21:1/5 to Paul on Tue Sep 26 09:38:44 2023
    On 9/25/2023 10:27 PM, Paul wrote:
    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


    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Slootweg@21:1/5 to sticks on Tue Sep 26 15:31:28 2023
    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').

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From sticks@21:1/5 to Frank Slootweg on Tue Sep 26 12:09:00 2023
    On 9/26/2023 10:31 AM, Frank Slootweg wrote:
    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.

    OK, I guess this is probably better, though I don't recall ever seeing a
    user control box pop up for anything other than something I initiated.
    I have the slider back up two notches and it just does it.

    Long: 'nircmd standby' indeed does not trigger a UAC popup. And yes,
    it just does the *sleep* (not "shutdown") without asking for anything.

    First time I tried it, without administrator privileges, it worked as
    desired. Out of curiosity, I checked the properties box on my shortcut
    to allow it to run with executive privileges and the user control box
    popped up. I switched back and un-clicked it and it is again gone. I
    would have thought it would be the other way around, but I have no idea
    why checking the box does that. Alas, it works.

    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').

    I did see your response, but didn't answer because the post didn't
    include any reference to the user control issue. Once I had figured
    that out without having to add the nirsoft utility, I figured that was
    good enough. But I now agree your way is better. I really should keep
    the slider up to notify for safety.

    Thanks to you and Paul.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to Frank Slootweg on Tue Sep 26 14:08:19 2023
    On 9/26/2023 11:31 AM, Frank Slootweg wrote:
    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').


    First I tested my "collection" of elevation tricks,
    and I was getting nowhere. Some of the tricks being broken now.

    I researched the rundll32 thing and saw comments to the
    effect that one is not perfect.

    Then I had to descend to third party (wizmo or nircmd),
    and I was relieved to get "something" to work :-/

    So that's how my day went.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)