Change Windows Boot Options for W2K8 -- WMI? batch?

已答覆 Change Windows Boot Options for W2K8 -- WMI? batch?

  • 2012年5月4日 下午 08:52
     
     

    I'm looking to change 3 values on boot that are Startup and Recovery parameters in Windows using a script or command-line binary.

    1. Time to display list of operating systems:
    2. Time to display recovery options when needed:
    3: Write debugging information

    I know for 1), you can use bcdedit /timeout 10 to change the value to 10 seconds. But I'm at a loss to figure out how to use bcdedit to modify the latter two. Any assistance would be greatly appreciated. References I've used to try and T/S this on my own:

    http://msdn.microsoft.com/en-us/library/windows/hardware/ff542202(v=vs.85).aspx
    http://technet.microsoft.com/en-us/library/cc731662(v=ws.10).aspx
    http://technet.microsoft.com/en-us/library/cc709667(v=ws.10).aspx

所有回覆

  • 2012年5月4日 下午 11:31
     
     已答覆

    gwmi Win32_OSRecoveryConfiguration|select *

    http://support.microsoft.com/kb/307973

    You can cofigure this with GPP.


    ¯\_(ツ)_/¯

    • 已標示為解答 thepip3r 2012年5月8日 下午 03:03
    •  
  • 2012年5月7日 上午 01:39
     
     
    thanx for the class jrv.  I found that WriteDebugInfo achieves what I was looking for for number 3.  But I'm still missing number 2.  Are you saying that the Time to display recovery options when needed is addressed in this class?  if so, how?
  • 2012年5月7日 上午 07:13
     
     已答覆

    Hello thepip3r,

    I have investigated number 2 in the past and at the time I came to the following two solutions:

    • The 'Time to display recovery options when needed' is stored in bootstat.dat. If the setting is changed manually on a system then the bootstat.dat can be copied to all systems with identical settings. Bootstat.dat can be found in %windir%\bootstat.dat
    • Open Sysdm.cpl and use sendkeys or equivalent to configure the setting using macros.

    Neither is perfect, I ended up using the first option.

    • 已標示為解答 thepip3r 2012年5月8日 下午 03:03
    •  
  • 2012年5月8日 下午 01:34
     
     

    Jaap... what is also contained in bootstat.dat?  I ask because the one on my system is like 66kb which means there's a lot more information in there than just this recovery setting.  I'm a little wary about overwriting this file on everyone's system without know what's actually in it.  And unfortunately, it's encoded/encrypted so I can't just open it and see the raw data -- which is probably why you said you had to make the change in the gui and then distribute the file in it's entirety.

  • 2012年5月8日 下午 01:49
     
     

    My assumption is that several settings in regards to boot & recovery are stored there. What is stored there exactly, I cannot tell you as I have been unable to find any official documentation in which the contents of the file are explained. What I do know is this:

    • If I change recovery timeout via the GUI this file changes
    • If I copy this file to another computer the settings in regards to recovery time are picked up by the other computer
    • If you backup the old bootstat.dat before copying the file the risk of something going wrong is quite low
    • It does not contain any information about boot configuration store as this is stored by BCDEdit on the system reserved partition or in \Boot folder
    • There is also a bootstat.dat file present on the system reserved partition or in the \Boot folder which usually has a different file size when compared to %windir%\bootstat.dat

    I would like to note that it is not a clean solution I proposed, but it is the best work-around I know of to achieve what you are trying to do. I am interested what you end up doing, so keep me up to date!

  • 2012年5月8日 下午 03:03
     
     
    I don't like either solution really.  Copying the file lends to a process whereby it will need to be regenerated and redistributed if we ever want to change another recovery setting.  I'm not a fan of macros considering this would need to be run with admin credentials so the guis wouldn't be available at startup and the user's won't have rights on logon.  I could do this through an SCCM package while a user is logged on but I just don't think it's that important to us.  I find another method of doing this more cleanly, I'll post back to this thread.  But at this point, I'll just thank you both for the assistance and consider this matter closed.