Last Updated on 2017-12-14.
[:en]Windows 10 Fall creators update brought a new “feature” which is not useful in most cases.
By default, most (not all) applications which were opened at shutdown time are now re-opened after a reboot. In most scenarios I’ve seen yet this is not a good behaviour, because the user does not expect it. He opens the applications himself and on many systems, the re-opening procedure takes too long, so applications eventually are opened with multiple instances.
This is a simple batch script you can use e.g. in your GPO (User configuration -> Logoff scripts). It cleans the registry’s RunOnce key from those entries.
for /f "tokens=1-3," %%a in ('reg query HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce /v "Application Restart*" ^| findstr "Application Restart"') do reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce /v "%%a %%b %%c" /f
(This is a slightly modified snippet from the reference below, the original produced a syntax error).
reg export HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce %temp%\regtest.reg
If you use this e.g. in a user logon or logoff script, you will see Windows creates temporary entries in the registry to re-open the applications:
The batch script above deletes those keys right after they have been created.[:]