This article describes how to use the bcdedit command to boot into Safe Mode when the normal method does not work.
Start Windows 10 in Safe Mode
Forcing Windows to restart into this special mode (or stopping it from starting in Safe Mode) is moderately difficult and will probably take only a few minutes at most. These instructions will start Safe Mode from the command prompt:
Open Advanced Startup Options if you're using Windows 11, Windows 10, or Windows 8. Since you can't start Windows properly, use method 4, 5, or 6 described in that tutorial.
With Windows 7 or Vista, you can start System Recovery Options using your installation media or a system repair disc. Unfortunately, this process does not work with Windows XP.