Saturday, June 2, 2007

Add "Reboot into Safe Mode" into Safe Mode

1. First open the notepad and copy following matter and name this file "Reboot Computer Into
Safe Mode.bat" without quotes,save this file to any (your's choice) location.



-----------------------------------------------------------------------------------------------------------------------------
@Echo Off

:: StartInSafeMode.bat - by [piyush]
:: Sets Windows XP to boot in Safe Mode / Normal Mode

Echo.

Find "default=" C:\boot.ini > default
For /f "skip=2 tokens=2,3* delims== " %%i IN (default) DO @set default=%%i
For /F "tokens=5,6* skip=4 delims=: " %%i IN (C:\boot.ini) DO @set mode=%%k

If "%mode%" == "/safeboot:minimal" (
Echo Safe mode detected.
Goto setnormalmode
) Else (
Echo Normal mode detected.
Goto setsafemode
)
Goto end

:setsafemode
attrib C:\boot.ini -s -r -h
echo> C:\boot.ini [boot loader]
echo>> C:\boot.ini timeout=30
echo>> C:\boot.ini default=%default%
echo>> C:\boot.ini [operating systems]
echo>> C:\boot.ini %default%="Windows XP Safe Mode" /noexecute=alwaysoff /fastdetect /safeboot:minimal
Echo. Your PC is now set to start in Safe Mode.
attrib C:\boot.ini +h +r +s
Goto end

:setnormalmode
attrib C:\boot.ini -s -r -h
echo> C:\boot.ini [boot loader]
echo>> C:\boot.ini timeout=30
echo>> C:\boot.ini default=%default%
echo>> C:\boot.ini [operating systems]
echo>> C:\boot.ini %default%="Microsoft Windows XP Professional" /noexecute=alwaysoff /fastdetect
Echo. Your PC is now set to start normally.
attrib C:\boot.ini +h +r +s
Goto end

:end
Del default
Set mode=
Set default=

Echo.
Echo. Press [X] to close this window.
Pause > nul

Shutdown -r
Exit
-----------------------------------------------------------------------------------------------------------------------------

2. Now suppose your windows xp is located in 'C' drive, then go to C:\Documents and Settings\All Users\Start Menu ,here right click in the empty place & select New >Shortcut, then browse to 'Reboot Computer Into Safe Mode.bat' file (saved in 1 step) then click next here you may give shortcut name as 'Reboot Computer Into Safe Mode' or of your choice.
(YOU MAY DRAG & DROP 'Reboot Computer Into Safe Mode.bat' FILE IF YOU WISH.)

3. Now click start then click just created shortcut, 'Reboot Computer Into Safe Mode', Click 'X' TO reboot into safe mode. That's all! For booting into Normal mode again click start & then 'Reboot Computer Into Safe Mode',Click 'X',now your computer will once again reboot to Normal mode.

No comments: