Lösenord, nollställ i windows

From Linuxwiki
Jump to navigation Jump to search

Nollställ (byt) lösenordet i W7

Vad texten nedan går ut på är att man ska skaffa åtkomst till den partition där windows ligger lagrat, oftast D: eller sda2 om det är W7. Sedan gör man en backup av filen sethc.exe och kopierar in cmd.exe istf sethc.exe. I linux:

cd <monteringspunkt för windows>/windows/system32 (Troligen stämmer inte denna sökväg alls)
mv sethc.exe sethc.exe_bck
cp cmd.exe sethc.exe

Starta om datorn och när windows inloggning kommer upp, tryck shift fem gånger. En kommandoprompt kommer upp. Skriv:

net user <ditt användarnamn> <nytt lösenord>

Har man inte koll på användarnamnet:

net user Visar vilka användare som finns.

Det ska nu gå att logga in med det nya lösenordet.

Efter att man fått till sitt nya lösenord bör man återställa sethc.exe. Då windows suger så får man åter boota från t ex linux och göra detta:

cd <samma sökväg som ovan>
mv sethc.exe_bck sethc.exe
Ev. får man bekräfta att man verkligen avser att skriva över sethc.exe. Efter att detta är klart ska det finnas en cmd.exe och en sethc.exe.


To reset a forgotten administrator password, follow these steps

1. Boot from Windows PE or Windows RE and access the command prompt.
2. Find the drive letter of the partition where Windows is installed.
   In Vista and Windows XP, it is usually C:, in Windows 7, it is D:
   in most cases because the first partition contains Startup Repair.
   To find the drive letter, type C: (or D:, respectively) and search
   for the Windows folder. Note that Windows PE (RE) usually resides on X:. 
3. Type the following command (replace “c:” with the correct drive
   letter if Windows is not located on C:):
      copy c:\windows\system32\sethc.exe c:\
   This creates a copy of sethc.exe to restore later. 
4. Type this command to replace sethc.exe with cmd.exe:
      copy /y c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe
   Reboot your computer and start the Windows installation where you forgot
   the administrator password. 
5. After you see the logon screen, press the SHIFT key five times. 
6. You should see a command prompt where you can enter the following
   command to reset the Windows password (see screenshot above):
      net user your_user_name new_password
   If you don’t know your user name, just type net user to list
   the available user names. 
7. You can now log on with the new password. 

I recommend that you replace sethc.exe with the copy you stored in the root folder of your system drive in step 3. For this, you have to boot up again with Windows PE or RE because you can’t replace system files while the Windows installation is online. Then you have to enter this command: copy /y c:\sethc.exe c:\windows\system32\sethc.exe