Offline change OS to boot in safemode+offline registry edit
#1
Posted 14 March 2012 - 02:57 AM
Supposing XP is the easiest part - batch file to process BOOT.INI,
After researching a bit I found that there is a way to handle Vista's/Win7 by WMI classes using VB scripts.
I also found BootICE which has a command line and handles XP/NT and Vista/Win7 but I can't find any tutorial for using it.
I understand that it's not possible to use bcdedit.exe from within LiveXP and that's what I'm looking for.
So my best options will be BootICE - if it can do so, or writing a script to make:
Identify OS type (XP-BOOT.ini or Vista/7- BCD)
edit the corresponding Boot Record to boot in safe mode.
Also for my purpose I need to change a few registry enteries offline for the OS to RunOnce a script,
What should be the best method - using
Offline NT Password & Registry Editor or using a batch script to use reg command from
WINPE instead of LiveXP?
I hope I posted it in the right forum hope to read some suggestions.
Thanks in advance!
#2
Posted 14 March 2012 - 07:31 AM
Something like:Supposing XP is the easiest part - batch file to process BOOT.INI
@echo off setlocal attrib -r -h -s %systemdrive%\boot.ini ren boot.ini boot.bak set inifile="%systemdrive%\boot.ini" echo [boot loader] >> %inifile% echo timeout=5 >> %inifile% echo default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS >> %inifile% echo. >> %inifile% echo [operating systems] >> %inifile% echo multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Safe Mode" /safeboot:minimal /sos /bootlog >> %inifile% echo multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Professional" /fastdetect /NoExecute=OptIn >> %inifile% attrib +r +h +s %systemdrive%\boot.ini endlocal
More options:
Possibly useful:Mode: Safe Mode
Switch: /safeboot:minimal /sos /bootlog /noguiboot
Mode: Safe Mode with Networking
Switch: /safeboot:network /sos /bootlog /noguiboot
Mode: Safe Mode with Command Prompt
Switch: /safeboot:minimal(alternateshell) /sos /bootlog /noguiboot
Mode: Enable Boot Logging
Switch: /bootlog
Mode: Enable VGA Mode
Switch: /basevideo
Mode: Directory Services Restore Mode (Domain Controllers Only)
Switch: /safeboot:dsrepair /sos
Mode: Debugging Mode
Switch: /debug
http://technet.micro...y/bb490870.aspx
Works from LiveXP:I understand that it's not possible to use bcdedit.exe from within LiveXP and that's what I'm looking for.
@echo off setlocal set title=Rescue Options for %%d in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do ( if exist %%d:\boot\bcd set bdr=%%d:\ ) set bcd=%bdr%boot\bcd set exe=%bdr%Windows\System32\bcdedit.exe copy %bdr% %bdr%bak %exe% /store %bcd% /create /d "%title%" /application bootsector for /f "tokens=3" %%a in ('%exe% /store %bcd% /create /d "%title%" /application bootsector') do set guid=%%a %exe% /store %bcd% /set %guid% device boot %exe% /store %bcd% /set %guid% path \grldr.mbr %exe% /store %bcd% /displayorder %guid% /addlast if not exist %bdr%xpe md %bdr%xpe xcopy xpe\*.* %bdr%xpe /i /y xcopy menu\*.* %bdr% /i /y endlocal
Identify OS type (XP-BOOT.ini or Vista/7- BCD)
set vbs="%temp%\filever.vbs" set file="%systemroot%\system32\ntdll.dll" echo Set oFSO = CreateObject("Scripting.FileSystemObject") >%vbs% echo WScript.Echo oFSO.GetFileVersion(WScript.Arguments.Item(0)) >>%vbs% for /f "tokens=*" %%a in ( 'cscript.exe //Nologo %vbs% %file%') do set filever=%%a del %vbs% for /f "tokens=1 delims=. " %%a in ("%filever%") do set winver=%%a if /i '%winver%'=='5' goto n5 if /i '%winver%'=='6' goto n6
Why not LiveXP? reg load should work http://www.petri.co...._windows_xp.htmAlso for my purpose I need to change a few registry enteries offline for the OS to RunOnce a script,
--
WINPE instead of LiveXP?
- Brito likes this
#3
Posted 14 March 2012 - 09:45 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users