You may encounter the issue whereby Command Prompt keeps popping up or This PC or Documents Folder opens automatically at startup in Windows 11 or Windows 10 PC. In this post, we offer suggestions you can try to rectify the anomaly if when you start Windows, the system boots successfully to the desktop and you see the Desktop.ini file text file.
What is desktop.ini on Windows 11/10?
The desktop.ini file on Windows 11/10 is a hidden file used to store information about the arrangement or settings of a Windows folder.
The Desktop.ini text file may contain either of the following string value;
In some cases, this text file appears blank. If you try to delete it, it will get deleted but it just gets recreated by the operating system as it is required to store the information about the folder layout.
The problem for some is when this file opens automatically at Windows startup when it should not be doing so! This unusual behavior happens if the Hidden attribute for the desktop.ini file in the Startup folder (shell:Startup) is somehow removed. Or, most likely, the Hide protected operating system files (Recommended) option in Folder or File Explorer Options is disabled.
Desktop.ini file opens automatically on startup in Windows 11/10
The Desktop.ini text file popping up has no known adverse effect on the system; but for many PC users that find this unusual occurrence irksome, to resolve the issue, you have to enable the hidden attribute for desktop.ini in your Startup and Common Startup folders to stop the file from opening on startup on your Windows 11/10 PC.
Do the following:
- Press Windows key + R to invoke the Run dialog.
- In the Run dialog box, type cmd and then press CTRL + SHIFT + ENTER to open Command Prompt in elevated mode.
- In the command prompt window, copy and paste the command below and hit Enter.
attrib +s +h "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini"
- Once the command executes, run the next command below:
attrib +s +h "%programdata%\Microsoft\Windows\Start Menu\Programs\Startup\desktop.ini"
- Exit CMD prompt once the command executes.
Now check your desktop and if the desktop.ini file you had deleted reappeared, then everything is okay. You can now reboot your PC and verify that the notepad file no longer automatically opens upon startup.
But, if you do not see the desktop.ini file after you have executed those commands, you can refresh your desktop once by right-clicking anywhere on the desktop and selecting Refresh from the context menu. If you still do not see the desktop.ini file, then you have probably run the commands incorrectly – check and re-run both commands.
Finally, if applicable to your case, make sure to re-enable the Hide protected operating system files (Recommended) option in Folder or File Explorer Options.
Related post: System32 folder opens automatically at startup
Why does Desktop.ini keep appearing?
The Desktop.ini file keeps appearing on your Windows 11/10 system mainly if the Hide protected operating system files option is unchecked in Folder Options. It is a system file that will be recreated automatically.
Is it OK to delete desktop.ini?
The desktop.ini file can be deleted from any directory, although it’s not advised. The file saves settings associated with the folder where it is contained, deleting it changes the folder settings back to default.
What is an ini file used for?
A Windows configuration (INItialization file) file is used to store settings for the operating system or application. It’s not a common practice for people to open or edit INI files, but they can be opened and changed with any text editor. Just double-clicking it will automatically open it in the Notepad application in Windows.
Read: List of Startup Paths, Folders and Registry Settings in Windows.