Skip to main content
Tools 2 mins

macOS: Preventing programs from automatically opening on restart

For a long time, the behavior of my Macs has been driving me crazy, reopening all previously open programs after every restart. But there’s a solution!

macOS: Preventing programs from automatically opening on restart

I work about 80% with Macs. Only when I’m not in the home office, in my studio and when tinkering with electronics in the workshop, I still have a PC with Windows in front of me.

However, what had been annoying me for a long time was the apparently non-switchable behavior of my Macs to reopen all previously opened programs on restart. The checkbox in the shutdown and restart dialog was not checked and yet the programs reopened on restart.

⚠ [affiliate] Keine Produkte mit Cache für default. Bitte affiliate-sync --lang en ausführen.

You also can’t get any further with the settings of the login items under General in the System Settings.

Ultimately, two commands that I found in the depths of the internet provided a solution. Simply open a terminal and first enter this command:

bash
1
sudo chown root ~/Library/Preferences/ByHost/com.apple.loginwindow.*

This assigns the list of programs that would be reopened on startup to the user Root, whereby macOS can no longer overwrite or replace them.

This command follows:

bash
1
sudo chmod 000 ~/Library/Preferences/ByHost/com.apple.loginwindow.*

with which all permissions are revoked. This means the list with the autostart programs can no longer be read or opened.

With this, the Mac will never again restart the last opened programs, regardless of whether the checkbox in the logout dialog is checked or not.

If you want to undo these settings, simply enter this command in the terminal:

bash
1
sudo rm -f ~/Library/Preferences/ByHost/com.apple.loginwindow.*

With this, the Mac recreates the list. For some, this command was also sufficient for the checkbox in the logout dialog to be taken into account again - unfortunately not for me. But I prefer to start the apps manually, so I’m happy to do without it.


Hi! I'm Markus – the Fricklr. ⚡ Electrical engineer, 🎵 musician (bass, guitar, keys) and professionally 'something with the internet' 🌐 for over 30 years – nowadays with AI too 🤖 – a 55-year-old generalist from Bavaria, Germany.

Your feedback helps me write even more interesting posts. After "Yes" there's also a small option to support my work.

Explore related topics

Content Map →
Show related content as a list
💡 Drag, hover & click to explore
Bigger dots are more relevant

What do you think? Leave a comment!

Share your thoughts, questions or experiences with the community.

Links marked with this symbol are affiliate links. As an Amazon Associate I earn from qualifying purchases. There are no additional costs for you.