Boot.ini - Last Known Good switch?

DCGPX

Member
Reaction score
2
Location
Bradford, United kingdom
I've searched and can't find an answer for this yet...

Is there a switch or command you can add to Boot.ini to display an option to start with Last Known Good Configuration?

I want to add the option as in the same as when you press F8?

I've found switches for nearly all options, safemode, networking etc except this one.

I do have a reason for needing it - Somehow (not figured out yet) a client has somehow perfected the knack of screwing up the start up and its always fixed by LKGC and then a normal shutdown/restart.

However getting them to hit F8 at right time and selecting LKGC is unbelievably hard work:rolleyes: so as an interim until I figure out how they manage to screw it up I wanted to add it as a start option but cant figure out how just yet.

Save me loads of calls and frustration this would as no matter how many time I go through this the client STILL manages to get confused - I'll end up saying something soon!!

I'm going in next week to watch what they are doing so hoped to edit ini file in meantime remotely till I understand what they are doing.

Any ideas?
 
Check out this site: http://thebackroomtech.com/2007/11/...indows-xp-with-last-known-good-configuration/

He's talking about automatically using LKGC, but you might be able to use the same switch for your purposes. It can't hurt to try...
BTW: the Sysinternals site he's referencing is outdated.

Thanks but I found this already but couldnt get it to work, unless my syntax wrong?

I have in the file

[boot loader] timeout=10 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Pro" /fastdetect /NoExecute=OptIn

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Pro - Last Known Good" /lastknowngood


But it just sits there when selected? Using F8 works fine
 
Man I wish my average customer was that patient, i'd be getting cursed out if a problem kept coming back over and over.

They're only patient because they accept its their own doing.

I have reloaded from scratch, sat most of the day and shutdown/restarted all Ok. It's when I leave them for a day or so they invariably manage it again.

I'm positive they are not shutting PC down properly, but cant as yet prove that and they swear blind they are shutting down ok. I think they are holding the power button till it goes off despite telling them to shut it down AND showing them how to numerous times.

I've had it on the bench and its never had an issue. I've checked their power and its stable, other PCs are OK, just this one that this one person uses.

I'm reseaching some way of monitoring if thats whats happening, same as if there was a power cut which is effectively what they are doing. This is why I think they are corrupting the registry.

I've agreed that they will try leaving PC on 24/7 and have set up power options to basically put it into hibernation if left untouched for 60min.

See how that goes.
 
Interesting topic. If this were to work, I'd be curious about adding it regularly to customer systems.

Just found this page:
http://www.pantz.org/software/windows/bootinistartupswitches.html
which seems to have a lot of switches, a few I've never even heard of.

(Script idea:
Change attribs on boot.ini, open it in Notepad, paste the LKGC default line into the clipboard, tech picks where to paste and makes any edits manually, saves and closes Notepad, once Notepad is gone, script re-attribs file.)
 
XP doesn't do security log by default so you need to enable auditing using audit policy in Local Security Policy, SecPol.msc and then check logs for " the last shutdown was unexpectd " event id 6008
 
reality != theory

^^^^^ Doesnt apply to XP.

I've tried rally hard to make a 6008 event appear and it just dont happen the way I expected it to do. You can check the logs for a clean shutdown if assume the event log service didnt crash by looking for a 6006 (event log stopped) then a 6009 on boot up followed by a 6005 (event log start)
Alternatively get hold of uptime.exe from http://support.microsoft.com/kb/232243 and run with the /s option. If you find two "Boot" together without a "Shutdown" you know something odd has ocurred.

forgetting how the old works different to the new stuff is embarrasing. Apologies to all for the duff gen.
 
Last edited:
Ok, this took a few seconds.
Code:
FileSetAttrib("C:\boot.ini","-rsh") [COLOR=Red];undo the attribs[/COLOR]
[COLOR=Red];put the line into the clipboard[/COLOR]
ClipPut('multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP - LastKnownGoodConfiguration" /lastknowngood')
RunWait("notepad c:\boot.ini") [COLOR=Red];wait for tech to paste line in and close notepad[/COLOR]
[COLOR=Red];be sure to doublecheck rdisk/partition/etc.[/COLOR]
FileSetAttrib("c:\boot.ini","+rsh") [COLOR=Red];reset the attribs[/COLOR]
EXE found here
 
User off till Monday now! And no-one bothered to switch his PC on even though I asked them to. I've an appointment Monday so will try to babysit and go through logs to see whats happening again!

^^^^^ Doesnt apply to XP.

I've tried rally hard to make a 6008 event appear and it just dont happen the way I expected it to do. You can check the logs for a clean shutdown if assume the event log service didnt crash by looking for a 6006 (event log stopped) then a 6009 on boot up followed by a 6005 (event log start)
Alternatively get hold of uptime.exe from http://support.microsoft.com/kb/232243 and run with the /s option. If you find two "Boot" together without a "Shutdown" you know something odd has ocurred.

forgetting how the old works different to the new stuff is embarrasing. Apologies to all for the duff gen.

Thanks, I'll try this if I cant get any joy from babysitting user Monday

Ok, this took a few seconds.
Code:
FileSetAttrib("C:\boot.ini","-rsh") [COLOR=Red];undo the attribs[/COLOR]
[COLOR=Red];put the line into the clipboard[/COLOR]
ClipPut('multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP - LastKnownGoodConfiguration" /lastknowngood')
RunWait("notepad c:\boot.ini") [COLOR=Red];wait for tech to paste line in and close notepad[/COLOR]
[COLOR=Red];be sure to doublecheck rdisk/partition/etc.[/COLOR]
FileSetAttrib("c:\boot.ini","+rsh") [COLOR=Red];reset the attribs[/COLOR]
EXE found here

Thanks for this as well - I'll try it to see if this works as my manual edit didn't
 
If the machine is powering off at random, it may perhaps be related to the customers environment, ie do they have any high current devices switching on or off on or near the circuit the computer is plugged into?
 
The PC wasn't shutting down randomly, issue is only when this one user is on. Went back yesterday as planned and talked it through with manager, it turns out the machine was used all weekend by another member of staff intermittently with no problems and was shut/restarted several times ok. It was pointed out by another member of staff that the usual user is impatient and 'gets annoyed' when it's shutting down so he can switch monitors etc off( this business has a policy that all users do this when finished for day) She thinks she's seen him flip the power sockets off to get away.

Even the non technical manager understood this will be causing problems, so he's had a word with me present that he/we will be monitoring the problem very closely and any more issues the user has to explain in minute detail what he was doing at shutdown and restart.

Told manager it will be hard to monitor events but he's savvy enough to know that we know that but user doesn't , we agreed not to put the LKGC line in the ini file so user HAS to tell when it's gone wrong.

Given we had 4 issues last week we agreed to see how this week goes seeing as it was fine over weekend with someone else on it.

Time will see. Thanks for all the input over it though.


www.tornadopc.com
 
Back
Top