Jump to content

restarting in safe mode


Recommended Posts

I was wanting to know if there is a code i can insert into a script to get a computer to reboot in safe mode? I allready know how to do it manually but I was wanting to automate it so that it doesnt take as long.

basically im looking for a code that when ran, will force the computer to reboot into safe mode.

[center][spoiler]My little joke!!!![/spoiler][/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center]Best code site ever[/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center][spoiler]My litte joke!!!![/spoiler][/center]

Link to comment
Share on other sites

Come on ppl, nobody knows? Im not going to use this for anything bad in fact, i dont think it could be used in a bad script. Even if it could, im not so childish that I would use auto it for anything like that.

[center][spoiler]My little joke!!!![/spoiler][/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center]Best code site ever[/center][center]!!!!!!!!!!!!!!!!!!!!!!!!!!!!![/center][center][spoiler]My litte joke!!!![/spoiler][/center]

Link to comment
Share on other sites

Here is how to force a boot into safe mode (Windows 2000/XP/2003, tested [manually] on Windows XP):

  • Suggestion: Backup C:\boot.ini , since if you screw up the computer may not boot. If the computer won't boot, you can restore this copy using the recovery console.
  • $myboot = IniRead("C:\boot.ini", "boot loader", "default")
  • Read through C:\boot.ini line by line and store in a variable ($newBoot). When you get to the line "[operating systems]", add the following line:

    $myBoot & '="Safe Mode" /safeboot:minimal /sos /bootlog'

    NOTE: This MUST be the first value of the "[operating systems]" section, and the key will duplicate your normal boot option, so I don't think you should use INIWrite to write this value. But you may be more adventurous than I. :)

  • Write out $newBoot to a new boot.ini file (like c:\boot2.ini). Verify that everything is right in the file. Then copy back to C:\boot.ini. Note that boot.ini is often read only and hidden.
When you reboot, the computer will look at the default boot option and take the first one that matches from the "operating systems" section. Even though there will be two matches, your Safe mode boot will be first, and so it will take precedence.

You might also want to change the value of 'timeout' in the 'boot loader' section so that the user doesn't have a chance to change to the normal boot. The normal boot will still be there, and if you are fast you can still get to it with the F5 key, but most users won't know this.

If you are adventurous, you can just grab the default boot option and then write a new Safe Mode boot into that option under "operating systems" using INIWrite. But I like how with the procedure above you preserve the normal boot option. In a pinch you can walk someone through pressing F5 and choose this option if need be.

BlueBearrOddly enough, this is what I do for fun.
Link to comment
Share on other sites

one could also use MSCONFIG to perform this function.

Not sure about vista support, but version of MSCONFIG will function from win98 to XPP.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...