In addition to the other answers: if by some chance, your problem lies in the registry (for instance, as in @isanae's comment on the accepted answer), you can edit the registry offline either by booting to another install of your version of Windows, or by using a setup/WinPE environment CD.
In short, open up the registry editor in your alternate OS (from WinPE or a setup disc, you can press Ctrl+F10 to open up a command prompt, then enter "regedit"). From there, you can create a new node in the registry tree, then use File -> Load Hive to choose the corresponding files for offline registry editing as follows:
[HKEY_LOCAL_MACHINE\SYSTEM] (%windir%/system32/config/SYSTEM)
[HKEY_LOCAL_MACHINE\SOFTWARE] (%windir%/system32/config/SOFTWARE)
[HKEY_USERS.Default] (%windir%/system32/config/DEFAULT)
[HKEY_CURRENT_USER] (%userprofile%/ntuser.dat)
From here, you can make whatever edits you need (SOFTWARE\Microsoft\Windows\CurrentVersion\Run, for example, holds your startup programs), and then save/close the hive you opened back to the same file.
40Also, this is a brilliantly simple way to destroy someone's computer. I'll try to remember this one just incase I ever meet someone that I really, really hate and I get 30 seconds with their computer. You could even use live boot media to access the filesystem and create the file without needing a password. – Keavon – 2015-08-23T04:22:16.570
@Keavon I'll take your advice :) post added to favorites – rpax – 2015-08-23T10:58:00.030
9This is beautiful – Mark K Cowan – 2015-08-23T19:21:32.670
This reminds me of How to mess up a PC running Windows 7?
– nixda – 2015-08-23T21:16:12.0534@Keavon Better yet, turn it into ransom-ware. ;) – jpmc26 – 2015-08-23T23:28:11.573
9what does this line of code actually means? – Ehsan Sajjad – 2015-08-24T13:03:32.617
9@EhsanSajjad - every time it executes, it spawns two new instances of itself. (which each spawn new instances, etc.) Eventually it consumes all available resources, and the computer becomes unusable. In a batch script, %0 stands for the executing batch script. – GalacticCowboy – 2015-08-24T14:27:31.983
Given the amusing nature of the question, I'm surprised nobody suggested
format C:
ordel /S C:\
as ways to remove the forkbomb from the Startup folder (note to beginners: do not try those commands, they'll remove everything else as well) – Mark K Cowan – 2015-08-25T08:16:27.100