piyush pathak Posted January 3, 2007 Share Posted January 3, 2007 (edited) Hi members,I just want to place a entry in the 'Start Menu' for 'safe boot' option. So that I can restart my WINDOWS-XP in safe mode without pressing F8 or without going to Boot menu option.PLEASE NOTE THAT I DON'T WANT TO USE ANY SOFTWARE FOR THIS.Help in this regard will be appreciated.THANKS. Edited January 3, 2007 by piyush pathak Link to comment Share on other sites More sharing options...
MGadAllah Posted January 3, 2007 Share Posted January 3, 2007 Does integrating an add on will help you?It will drop a link in the start menu named reboot into safe modeif so, take a look here Hope this help Link to comment Share on other sites More sharing options...
piyush pathak Posted January 4, 2007 Author Share Posted January 4, 2007 Dear MGadAllah,Thanks for your kind help.But is it not possible to do this tweak without Third party software ?Anybody else? Link to comment Share on other sites More sharing options...
[deXter] Posted January 4, 2007 Share Posted January 4, 2007 Well you can add a safe mode option to your boot menu so you can get into the safe mode without pressing F8. Press Windows + R to open the Run command.Type attrib C:\boot.ini -s -h -rPress Enter.Press Windows + R againType notepad C:\boot.iniPress Enter.Now copy paste the last line to a new line and the end of the last line, add /SAFEBOOT:minimalAlso change "Microsoft Windows XP Professional" to something like "XP Safemode" so that you can distinguish between the two choices.Change the timeout= to the amount of time you want the boot menu to be displayed (default is 30 seconds).Now when you boot your comp, you'll automatically get two choices, normal and safemode. It'll boot into normal mode by default.For eg, here's how my boot.ini would look like (may be different from yours so do not copy paste from this)[boot loader]timeout=5default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS[operating systems]multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=alwaysoff /fastdetectmulti(0)disk(0)rdisk(0)partition(1)\WINDOWS="XP Safemode" /noexecute=alwaysoff /fastdetect /safeboot:minimalNow although this isn't exactly what you wanted, it does the trick. Now if you wanted it on your start menu though, I could write an elaborate .bat file to do it. And it would still qualify under your non-thidparty software requirement. Link to comment Share on other sites More sharing options...
piyush pathak Posted January 4, 2007 Author Share Posted January 4, 2007 Dear deXter,Thanks for co-operation. please attach bat file for my purpose. please give details how can i pin to start menu & do safe mode from there. If i wish to revert back to normal mode option for the same should be there in the start menu.please explain in detail.thank you. Link to comment Share on other sites More sharing options...
MGadAllah Posted January 4, 2007 Share Posted January 4, 2007 Well you can add a safe mode option to your boot menu so you can get into the safe mode without pressing F8. Press Windows + R to open the Run command.Type attrib C:\boot.ini -s -h -rPress Enter.Press Windows + R againType notepad C:\boot.iniPress Enter.Now copy paste the last line to a new line and the end of the last line, add /SAFEBOOT:minimalAlso change "Microsoft Windows XP Professional" to something like "XP Safemode" so that you can distinguish between the two choices.Change the timeout= to the amount of time you want the boot menu to be displayed (default is 30 seconds).Now when you boot your comp, you'll automatically get two choices, normal and safemode. It'll boot into normal mode by default.For eg, here's how my boot.ini would look like (may be different from yours so do not copy paste from this)[boot loader] timeout=5 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=alwaysoff /fastdetect multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="XP Safemode" /noexecute=alwaysoff /fastdetect /safeboot:minimalNow although this isn't exactly what you wanted, it does the trick. Now if you wanted it on your start menu though, I could write an elaborate .bat file to do it. And it would still qualify under your non-thidparty software requirement.This was a good trick mateI'm too interested to know how to put it in Start menu...and I will stop using this 3rd-party add on ofcourse Link to comment Share on other sites More sharing options...
[deXter] Posted January 6, 2007 Share Posted January 6, 2007 (edited) @Echo Off:: StartInSafeMode.bat - by [deXter]:: Sets Windows XP to boot in Safe Mode / Normal ModeEcho.Find "default=" C:\boot.ini > defaultFor /f "skip=2 tokens=2,3* delims== " %%i IN (default) DO @set default=%%iFor /F "tokens=5,6* skip=4 delims=: " %%i IN (C:\boot.ini) DO @set mode=%%kIf "%mode%" == "/safeboot:minimal" ( Echo Safe mode detected. Goto setnormalmode) Else ( Echo Normal mode detected. Goto setsafemode)Goto end:setsafemodeattrib C:\boot.ini -s -r -hecho> C:\boot.ini [boot loader]echo>> C:\boot.ini timeout=30echo>> C:\boot.ini default=%default%echo>> C:\boot.ini [operating systems]echo>> C:\boot.ini %default%="Windows XP Safe Mode" /noexecute=alwaysoff /fastdetect /safeboot:minimalEcho. Your PC is now set to start in Safe Mode.attrib C:\boot.ini +h +r +sGoto end:setnormalmodeattrib C:\boot.ini -s -r -hecho> C:\boot.ini [boot loader]echo>> C:\boot.ini timeout=30echo>> C:\boot.ini default=%default%echo>> C:\boot.ini [operating systems]echo>> C:\boot.ini %default%="Microsoft Windows XP Professional" /noexecute=alwaysoff /fastdetectEcho. Your PC is now set to start normally.attrib C:\boot.ini +h +r +sGoto end:endDel defaultSet mode=Set default=Echo.Echo. Press [X] to close this window.Pause > nulExitCopy paste in notepad, save as something.batIf you want it on your start menu, create a shortcut to it and Pin it up!This single bat file will toggle between safemode and normal mode. If you want it to reboot your PC automatically too, add a Shutdown -r at the end, before the exit. Edited January 7, 2007 by [deXter] Link to comment Share on other sites More sharing options...
piyush pathak Posted January 6, 2007 Author Share Posted January 6, 2007 Dear deXter,Thanks for the posting .bat file!I have copied your text (of course with your name for credit!) & made .bat file exactly as you mentioned. After that I ran it, I find that it has changed my boot.ini file as this:[boot loader]timeout=30default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS[operating systems]multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Safe Mode" /noexecute=alwaysoff /fastdetect /safemode:minimalAfter that change in boot.ini I rebooted but nothing happened! System does not start in safe mode. Please note that I have three partitions on my HDD, namely C,D,E. windows xp is on C drive.please guide me what is the mistake?Thanks again! Link to comment Share on other sites More sharing options...
[deXter] Posted January 7, 2007 Share Posted January 7, 2007 Whoops, typo!Edit the file, please download it again Link to comment Share on other sites More sharing options...
piyush pathak Posted January 7, 2007 Author Share Posted January 7, 2007 :whistle: Thank you deXter!!! Link to comment Share on other sites More sharing options...
[deXter] Posted January 7, 2007 Share Posted January 7, 2007 Because you asked for it, here's how the bat file works: (I'm posting it here as it maybe useful for others too)Firstly, this whole file depends on the boot.ini trick. Its something I discovered at Sysinternals, so do have a look there for other lesser-known boot.ini switches.Secondly, this could have also been done by using the command bootcfg which allows one to query and write the boot.ini values such as the deafult OS, the default switches, etc.You could use bootcfg in the command shell as follows::: This saves the switches to a file called "options"bootcfg | find "OS Load Options" > options:: The variable %k will contain safeboot if the boot.ini has been set to safemodefor /f "tokens=2,3* delims== " %i IN (options) do @echo %k:: The variable %j contains switches other than /safebootfor /f "tokens=4,5 delims= " %i in (options) do @echo %i %jType bootcfg /? at the command promt for more info.Thirdly, you don't have to do it by bat. Windows also supports a better form of scripting called WSH, which some might find it simpler. (It's definately more powerful though).However, if you're still interested in Batch file programming, have a look at this Interactive Batch Course.Plus, you can always have a look at the (very detailed) help for these commands by typing them at the command prompt followed by a /?. For eg, to know how For works, type For /?.However, there are some undocumented tricks you won't find at these sites or the help files. Tricks like using echo>> filename text as opposed to echo text >> filename and using :: for comments instead of REM.. the list is endless. For more of such undocumented tricks, I suggest having a look at Mr. Tom Lavedas's work. Link to comment Share on other sites More sharing options...
piyush pathak Posted January 8, 2007 Author Share Posted January 8, 2007 (edited) I think this post became quite interesting for everyone. In this post anyone who don't like to take pain of making bat file or boot.cfg method can easily download utility linked in second post .And knowledge hungry people can go deXter way! Edited January 15, 2007 by piyush pathak Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now