I locked myself out of my old windows 7 machine (forgot my admin password). However, I know about this sethc.exe trick to reset a forgotten password. So, I created a bootable linux distro, swapped sethc.exe
and cmd.exe
executables, booted windows, set a new admin password, booted linux and swapped the executables back. Unfortunately, I was too bored/not paying attention and ended up actually deleting my cmd.exe
executable.
Even though powershell works just fine, not having a cmd.exe
might lead to unexpected things. It would be nice to somehow restore that, but I am not a windows admin/haven't used windows for quite a while. Any ideas how one could restore this executable?
Best Answer
How can I restore
cmd.exe
executable?Use
sfc /scannow
How do I run the System File Checker tool (SFC.exe)?
Source Use the System File Checker tool to repair missing or corrupted system files