-
Senior Member
registered user
Reset Lost Windows Admin Passwords
Heres a small script I wrote that auto detects if Vista or XP is in Use. It then mounts the partition
and runs chntpw in interactive mode. If dual boot i.e. Vista and XP are in use, it detects both OS's
giving the option to reset or quit.
You can copy the lines inssert the file onto a usb drive. Next time you use knoppix 5.11 or 5.31
install chntpw first:
apt-get update
apt-get install chntpw
Use the script at your own risk, theres always an element of piracy hence the warning message.
#!/bin/sh
#password reset for XP/Vista run as sudo or kdesu
#
#
clear
echo -e "\E[32m Reset Password Utility for XP and Vista"
echo
echo
echo
for i in hda1 hda2 hda3 hda4 hdb1 hdb2 hdb3 hdb4 sda1 sda2 sda3 sda4 sdb1 sdb2 sdb3 sdb4
do
mkdir /media/$i 2>/dev/null
mount /dev/$i /media/$i 2>/dev/null
# Detect WinXP
if [ -e /media/$i/boot.ini ]; then
echo -e "\E[37m Windows XP detected on /dev/$i"
echo
echo -e "\E[33m Warning:";echo -e "\E[31m Please ensure you have a reasonable guarantee from the customer that
this computer is owned by them before proceeding."
echo -e "\E[32m "
echo
sleep 6
chntpw -i /media/$i/WINDOWS/system32/config/SAM
umount /media/$i
fi
# Detect Vista
clear
if [ -e /media/$i/Users ]; then
echo -e "\E[36m Windows Vista detected on /dev/$i"
echo
echo -e "\E[33m Warning:";echo -e "\E[31m Please ensure you have a reasonable guarantee from the customer that
this computer is owned by them before proceeding."
echo -e "\E[36m "
echo
echo
sleep 6
chntpw -i /media/$i/Windows/System32/config/SAM
umount /media/$i
fi
if [ $i == sdb4 ] && [ -e /media/$i/Users -o -e /media/$i/boot.ini ]; then
echo -e "\E[36m No Operating System detected"
sleep 4
fi
done
Similar Threads
-
By askme in forum MS Windows & New to Linux
Replies: 8
Last Post: 09-25-2017, 02:47 AM
-
By spiferpipit in forum MS Windows & New to Linux
Replies: 3
Last Post: 04-18-2007, 10:09 AM
-
By Slinky in forum MS Windows & New to Linux
Replies: 6
Last Post: 04-23-2006, 08:02 PM
-
By JPsDad in forum MS Windows & New to Linux
Replies: 0
Last Post: 01-23-2005, 09:03 PM
-
By dave52355 in forum Hdd Install / Debian / Apt
Replies: 5
Last Post: 10-30-2003, 07:29 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Dell Poweredge R640 Server | 2x Xeon Gold 6132 | 128GB | H730P | 8x HDD Trays
$1849.00
Dell Poweredge R640 Server | 2x Silver 4114 20 Cores | 96GB | 8x 1.8TB Dell SAS
$2749.99
Dell Poweredge R640 Server | 2x Silver 4114 20 Cores | 64GB | 8x HDD Trays
$1614.99
Dell PowerEdge R730 Server 2.30Ghz 32-Core 128GB 8x 3TB 12G H730P ESXi 7.0
$803.70
Dell PowerEdge R620 Server 2x E5-2660 v1 2.2GHz 16 Cores 256GB RAM 1x 300GB HDD
$89.99
Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 128GB RAM No HDD
$389.99
SuperMicro Server 505-2 Intel Atom 2.4GHz 8GB RAM SYS-5018A-FTN4 1U Rackmount
$202.49
HP Proliant DL360 Gen9 28 Core SFF Server 2X E5-2680 V4 16GB RAM P440ar No HDD
$196.95
DELL PowerEdge R630 8SFF Server 2x E5-2680v3 2.5GHz =24 Cores 32GB H730 4xRJ45
$240.00
1U Server (6-8 VM's) Vsphere VPS Short Depth 20" XEON 3.5Ghz 32GB RAM X10SLM-F
$199.00