Stop apps from re-opening after shutdown/restart- 1709 Fall Creators


  1. Posts : 10
    Windows 7/8/10
       #1

    Stop apps from re-opening after shutdown/restart- 1709 Fall Creators


    I came across this new behavior a couple days ago and thought I did something screwy to my image. I read Bree's post and found it's an intended feature now on a restart Fall Creators Update reopens apps from before

    That thread has some good suggestions for alternate shutdown methods. The intention of this tutorial is to restore pre-1709 (like) functionality to the normal Restart and Shut down buttons in the Start menu.

    Since the default reboot behavior uses the shutdown.exe slash G switch - applications that are left open will attempt to "register" themselves to be re-opened. This is done by creating a RunOnce value at logoff, so you won't see it while online. Not all apps are capable of registering themselves in this way and can't be re-opened automatically.

    In the below screenshot I have left a few programs open, shutdown the computer, then booted to WinPE and loaded my HKCU hive in regedit. You can see the apps that are going to be re-opened once I boot back up, each named like "Application Restart".
    Stop apps from re-opening after shutdown/restart- 1709 Fall Creators-clipboard05.jpg

    The script below will remove every value starting with "Application Restart #"
    Code:
    $HKCURunOnce='HKCU:Software\Microsoft\Windows\CurrentVersion\RunOnce'
    (Get-ItemProperty $HKCURunOnce).PSObject.Properties | 
    Where-Object {$_.Name -like "Application Restart #*"} |
    ForEach {Remove-ItemProperty -Path $HKCURunOnce -Name $_.Name}

    You can set this as a user logoff script in gpedit or gpmc, or use the attached scripts:

    -Extract "NoApplicationRestart.zip"
    -Run "NoApplicationRestart_INSTALL.bat"

    I have tested this with Enterprise and Pro, not sure if Home supports the group policy side of it all. You will need local admin permission to make the required changes.
    Last edited by harvey263; 08 Dec 2017 at 23:22.
      My Computer


  2. Posts : 5,452
    Windows 11 Home
       #2

    I remove all startup entries at shutdown and RadeonSettings.exe still started, only using shutdown command helped.
    Attached Thumbnails Attached Thumbnails Stop apps from re-opening after shutdown/restart- 1709 Fall Creators-capture_12092017_141801.jpg  
      My Computer


  3. Posts : 10
    Windows 7/8/10
    Thread Starter
       #3

    harvey263 said:
    You can set this as a user logoff script in gpedit or gpmc, or use the attached scripts:

    -Extract "NoApplicationRestart.zip"
    -Run "NoApplicationRestart_INSTALL.bat"
    I have removed this attachment from my original post because I realized the install batch was not working after testing some more. Do this instead:
    copy this code into Notepad and save it as "NoApplicationRestart.ps1"
    Code:
    $HKCURunOnce='HKCU:Software\Microsoft\Windows\CurrentVersion\RunOnce'
    (Get-ItemProperty $HKCURunOnce).PSObject.Properties | 
    Where-Object {$_.Name -like "Application Restart #*"} | 
    ForEach {Remove-ItemProperty -Path $HKCURunOnce -Name $_.Name}

    Open "gpedit.msc" and go to User Configuration > Windows Settings > Scripts (Logon/Logoff)
    Open Logoff Properties and click the "PowerShell Scripts" tab
    Click "Add" then "Browse" and select the "NoApplicationRestart.ps1" file
    gpedit will look in "C:\Windows\System32\GroupPolicy\User\Scripts\Logoff" by default, but you can save it elsewhere.
    Click OK to save it. Then you can leave a few apps open and restart the computer to test if it's working.
    Stop apps from re-opening after shutdown/restart- 1709 Fall Creators-logoffscript.png

    I wish I could have edited my original post. Not sure if I'm being dense, but can't find the pencil button anywhere.
    EDIT: ah, probably just too late to edit the first one
      My Computer


  4. Posts : 10
    Windows 7/8/10
    Thread Starter
       #4

    TairikuOkami said:
    I remove all startup entries at shutdown and RadeonSettings.exe still started, only using shutdown command helped.

    How are you calling OFF.bat? If by "remove all startup entries at shutdown" you mean it is a Shutdown script (like below), that won't work.

    Stop apps from re-opening after shutdown/restart- 1709 Fall Creators-shutdownscripts.png

    The "Application Restart" RunOnce values get created after a Computer Shutdown script is run. You need to run it as a User Logoff script instead. I have an AMD card as well but don't seem to have RadeonSettings.exe installed to test that specific application. You should inspect your offline registry after shutting down to confirm what your batch file is actually accomplishing.

    EDIT: Thinking about it some more, Computer Shutdown scripts are run as the System account. So the reason that method doesn't work is because the wrong HKCU hive is being targeted. I'd still be curious to know how you are running your batch.
    Last edited by harvey263; 09 Dec 2017 at 13:14.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:03.
Find Us




Windows 10 Forums