Mark Minasi's Tech Forum
Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
timwiser

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 19
Reply with quote  #1 
Hi chaps,

I'm trying to use BCDEdit.exe to add a permanently available DSRM boot mode item to domain controllers under our management.  I've got the following batch file which works a treat and adds the DSRM item.  I've tested a boot and checked that the DSRM mode is functional.  I thought it was done and dusted.... until I checked msconfig and found that for the DSRM item, the safeboot and dsrepair options had become unticked after the DSRM mode had been booted into.

@echo off
bcdedit | findstr /C:"Directory Services Restore Mode" >nul
if %errorlevel% EQU 0 goto [biggrin]ONE
for /f "tokens=7" %%d in ('bcdedit /copy {current} /d "Directory Services Restore Mode"') do SET GUID=%%d
set GUID=%GUID:.=%
bcdedit /set %GUID% safeboot dsrepair
if %errorlevel% NEQ 0 echo An error occurred when trying to add the boot menu item && goto :END
bcdedit /timeout 30
echo DSRM mode has been added to the boot menu
goto END

[biggrin]ONE
echo DSRM mode has already been added to the boot menu
:END

It's as if the BCDEdit.exe utility needs a way to tick the "Make boot changes permanent" checkbox in msconfig....

Anyone know where I'm going wrong?
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.