Author Topic: Accessing Safe mode in windows 7 or 8 via batch file script (updated final)  (Read 4649 times)

0 Members and 1 Guest are viewing this topic.

Offline Julian

  • "Cat and Mum Guy"
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Jun 2015
  • Posts: 1320
  • Location: USA, New Mexico
  • Karma: 38
    • View Profile
Windows repair version 3.2.4 is out and has been updated to incorporate this option in the program go get it  :wink:

http://www.tweaking.com/content/page/windows_repair_all_in_one.html

Since Shane Incorporated the boot to safe mode he offers a much safer version of this. I recommend using the windows repair all in one. I removed the batch file script but left the uploaded batchfile. The reason I left the batch file uploaded is because the batch file will allow you to choose which version of safe mode you would like to access while the repair all in one just does safe mode with networking.

(updated to to {current} instead of {default} for users with dual booting OS)
(changed color of command prompt the other color hurt my eyes lol.)
(Added please wait after adding reg key noticed it may take a couple seconds for key to be added to registry)
(okay so I spent about an hour fixing minor things let me know if I should change anything or questions on it.)
« Last Edit: August 12, 2015, 06:58:59 PM by Julian »
Julian

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 135
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
oooh, I like this :-)

I was going to try and find a way to make getting into safe mode from my windows repair program easier and hopefully with a click of a button.

I knew about the bcdedit commands, but it makes them perment so the user would need to run it again to boot back into normal mode, so until I found a way to automate that I havent added it to the program.

But your idea is perfect, run the command and then set it in the registry under the run once to set it back, so when they boot into safe mode it is changed back to normal.

But, does safe mode run the runonce reg key though, I know it skips the startup of all the others, so i didnt think about using any form of startup.

Shane
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline Julian

  • "Cat and Mum Guy"
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Jun 2015
  • Posts: 1320
  • Location: USA, New Mexico
  • Karma: 38
    • View Profile
*normalboot /t Reg_SZ /d "bcdedit /deletevalue {default} safeboot"
 GOTO Item_6

Shane I thought of that too you see the asterisk?

https://msdn.microsoft.com/en-us/library/aa376977(v=vs.85).aspx

I stumbled upon that link awhile back. remembered there was a way... so Basically:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
•HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
•HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
•HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
By default, these keys are ignored when the computer is started in Safe Mode. The value name of RunOnce keys can be prefixed with an asterisk (*) to force the program to run even in Safe mode.

By default, the value of a RunOnce key is deleted before the command line is run. You can prefix a RunOnce value name with an exclamation point (!) to defer deletion of the value until after the command runs. Without the exclamation point prefix, if the RunOnce operation fails the associated program will not be asked to run the next time you start the computer.

I've tested this on windows 7 and 8. not windows xp not sure if that os used bcdedit.
If you like this Shane you can use this in your tool and take out the created by Sundavor.
« Last Edit: June 11, 2015, 03:20:23 PM by Sundavor »
Julian

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 135
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
Quote
The value name of RunOnce keys can be prefixed with an asterisk (*) to force the program to run even in Safe mode.

Oh my.... this is a nice find  :cheesy:

I am in the middle of moving to our new place and so over the next week I am going to be super busy getting my wife and 5 kids and my office all moved. I will try to keep up on forum posts and emails but not much else till I am moved, can you do me a fav and give me a reminder in about a week or so about this?

Shane
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline Julian

  • "Cat and Mum Guy"
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Jun 2015
  • Posts: 1320
  • Location: USA, New Mexico
  • Karma: 38
    • View Profile
Quote
The value name of RunOnce keys can be prefixed with an asterisk (*) to force the program to run even in Safe mode.

Oh my.... this is a nice find  :cheesy:

I am in the middle of moving to our new place and so over the next week I am going to be super busy getting my wife and 5 kids and my office all moved. I will try to keep up on forum posts and emails but not much else till I am moved, can you do me a fav and give me a reminder in about a week or so about this?

Shane

Yes Sir will do.
My goal is to help out in any way I can with this program and make it the best AIO repair out there  :wink:
Julian

 

anything