Jump to content


  • 0
thadkew

Is this possible?

Question

I might have a hard time explaining this, but here goes:

 

I would like to have a separate partition created that can be used for local imaging. Meaning that I'd like a "Z:" drive created that can be used to boot and image the C drive if there is a corruption on C.

This Z drive would work similarly to a USB drive that has the MDT Media on it.

 

Does that make sense? Can it be done?

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Yes it is possible. And it works well.

I created a new application with a text file and the Lite Touch wim in a folder and a bat file to do the leg work:

The text file preforms the diskpart functions and the bat file does the rest:

Here's the text file:

 

select disk 0

select partition 2

assign letter v

 

And here's the bat file:

 

REM copy diskpart command file

xcopy "%~dp0recover_zone.txt" c:\

REM run diskpart

diskpart /s c:\recover_zone.txt

ping -i 127.0.0.1 >NUL

REM copy WIM and SDI

xcopy "%~dp0LiteTouchPE_x86-(2).wim" v:\

xcopy "%~dp0boot.sdi" v:\

ping -i 127.0.0.1 >NUL

REM Delete file

del c:\recover_zone.txt

 

REM bcdedit /create /d "Windows 7" /application osloader

echo Exporting the system BCD store to BcdTemp

bcdedit /export BcdTemp

REM if errorlevel 1 echo Error - we need to have admin privileges.

REM if errorlevel 1 goto Endit

 

rem Set the name of the Winpe .wim file

set WimNm=LiteTouchPE_x86-(2).wim

 

rem Set the name of the WinPE .sdi file

set SdiNm=boot.sdi

 

rem Set the drive where the two WinPE boot files are located ( x: with no \ )

set WPDrv=V:

 

rem Set the folder path to the WinPE boot files ( no drive letter, no trailing \ )

set WPPth=

 

rem Description that shows up in the boot menu

set WPDes="Recovery"

 

rem Create the osloader and device options entries in the bcd store.

rem Get the randomly created GUID numbers that uniquely identify our two entries.

 

For /F "tokens=3 delims= " %%1 in ('bcdedit.exe /store BcdTemp /create /application OSLOADER /d %WPDes%') do set guid1=%%1

echo Osloader entry id is %guid1%

 

For /F "tokens=3 delims= " %%1 in ('bcdedit.exe /store BcdTemp /create /device /d %WPDes%') do set guid2=%%1

echo Device options entry id is %guid2%

 

echo Setting items in the osloader entry

 

bcdedit /store BcdTemp /set %guid1% device ramdisk=[%WPDrv%]%WPPth%\%WimNm%,%guid2%

bcdedit /store BcdTemp /set %guid1% osdevice ramdisk=[%WPDrv%]%WPPth%\%WimNm%,%guid2%

bcdedit /store BcdTemp /set %guid1% path \windows\system32\boot\winload.exe

bcdedit /store BcdTemp /set %guid1% locale en-US

bcdedit /store BcdTemp /set %guid1% inherit {bootloadersettings}

bcdedit /store BcdTemp /set %guid1% systemroot \windows

bcdedit /store BcdTemp /set %guid1% detecthal Yes

bcdedit /store BcdTemp /set %guid1% winpe Yes

bcdedit /store BcdTemp /set %guid1% ems No

 

echo Setting items in the device options entry

bcdedit /store BcdTemp /set %guid2% ramdisksdidevice partition=%WPDrv%

bcdedit /store BcdTemp /set %guid2% ramdisksdipath %WPPth%\%SdiNm%

 

echo Setting bootmgr to include the WinPE entry in the boot display list

bcdedit /store BcdTemp /set {bootmgr} displayorder %guid1% /addlast

 

rem Create an undo cmd file to delete the entries directly from the system bcd store.

echo Creating the DelWinpe.cmd undo command file

echo bcdedit /delete %guid1% >>DelWinpe.cmd

echo bcdedit /delete %guid2% >>DelWinpe.cmd

 

echo Display bootmgr and the two new entries

bcdedit /store BcdTemp /enum {bootmgr}

bcdedit /store BcdTemp /enum %guid1%

bcdedit /store BcdTemp /enum %guid2%

echo.

 

If errorlevel 1 echo Error - something went awry. Not importing the temporary store.

If errorlevel 1 goto Endit

 

REM echo Ready to import the temporary store into bcd system store...

REM pause

 

echo Importing BcdTemp into the system BCD store.

bcdedit /import BcdTemp

 

:Endit

set guid1=

set guid2=

set WpDrv=

set WPPth=

set WimNm=

set SdiNm=

set WPDes=

 

 

bcdedit /timeout 3

 

I found the meat of the script here http://social.technet.microsoft.com/Forums/en-US/itprovistasetup/thread/333f16c6-efca-4899-8cf2-95f05af61986/

 

Then i put the task at the end of my task sequence. Tested and it works!!!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.