here is the script I have made.
@echo off
for /f "tokens=1* delims= " %%i in ('bcdedit /v') do call :SetVAR "%%i" "%%j"
if [%SystemDrive%]==[C:] (
if [%ROLLBACK%]==[] (
echo Could not found Roll Back identifier*****
)
if NOT [%ROLLBACK%]==[] (
echo Set boot default to Roll Back identifier of %ROLLBACK%
bcdedit /set {bootmgr} default %ROLLBACK% >nul
bcdedit /set {bootmgr} timeout 0 >nul
)
)
if [%SystemDrive%]==[X:] (
if [%WINDOWS7%]==[] (
echo Could not found Windows 7 identifier*****
)
if NOT [%WINDOWS7%]==[] (
echo Set boot default to Windows 7 identifier of %WINDOWS7%
bcdedit /set {bootmgr} default %WINDOWS7% >nul
bcdedit /set {bootmgr} timeout 0 >nul
)
)
goto end
:SetVAR
if %1=="identifier" set ID=%~2
if %1=="description" (
if %2=="Roll Back Windows" set ROLLBACK=%ID%
if %2=="Windows 7" set WINDOWS7=%ID%
)
goto end
:end