0

I have a Windows 7 USB bootup disk that I am using to write wim images to a standard Intel PC - a new PC.

The batch file applyimage.bat runs the following commands:

DISKPART /s WipeDisk.txt
ImageX /apply imagefile.wim 1 c:\
bcdedit /set {default} device partition=c:
bcdedit /set {default} osdevice partition=c:
bcdedit /set {bootmgr} device partition=c:

and the text file WipeDisk.txt contains:

SELECT DISK 0
CLEAN
CREATE PARTITION PRIMARY
FORMAT QUICK FS=NTFS LABEL="Windows"
ACTIVE
ASSIGN LETTER="C"

When I run the batch file I get this output:

E:\>applyimage.bat

E:\>DISKPART /s WipeDisk.txt

Microsoft DiskPart version 6.1.7600
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: MININT-135E5ES

Disk 0 is now the selected disk.

DiskPart succeeded in cleaning the disk.

DiskPart succeeded in creating the specified partition.

  100 percent completed

DiskPart successfully formatted the volume.

DiskPart marked the current partition as active.

DiskPart successfully assigned the drive letter or mount point.

E:\>ImageX /apply imagefile.wim 1 c:\

ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7600.16385


[ 100% ] Applying progress

Successfully applied image.

Total elapsed time: 8 min 22 sec




E:\>bcdedit /set {default} device partition=c:
The boot configuration data store could not be opened.
The system cannot find the file specified.

E:\>bcdedit /set {default} osdevice partition=c:
The boot configuration data store could not be opened.
The system cannot find the file specified.

E:\>bcdedit /set {bootmgr} device partition=c:
The boot configuration data store could not be opened.
The system cannot find the file specified.

E:\>

When I reboot the PC I get this error:

BOOTMGR is missing
Press Ctrl+Alt+Del to restart

How can I fix this?

And how do I fix the initial error in the applyimage.bat file?

UPDATE: If I remove the 3 bcdedit lines and replace with:

bcdboot C:\Windows

it does seem to work.

I am concerned though that I don't understand the implications of making that change. And why I suddenly need it for a new PC - which is just an upgrade from the old one.

The bcdedit lines worked on an Advantech UNO-2184G (probably 4-5 years old) but not on the new Advantech UNO-2484G.

5
  • You need more then a single partition if you want to boot to windows unless you are making the Windows partition itself, the boot partition which isn't standard by any stretch of the imagination. I find it difficult you applied a Windows image within 8 minutes to a partition, having used a script that applied multiple .wim images to HDD, I can say it took much longer then 8 minutes
    – Ramhound
    Commented Feb 22, 2018 at 13:11
  • @Ramhound previously it took about 15 minutes on a different PC, but this PC is newer so may account for it copying quickly. It does the first part ok but fails on the bcdedit part.
    – user619818
    Commented Feb 22, 2018 at 13:29
  • @Ramhound The original applyimage.bat had D: line before imagex line and the wim file was full path D:\imagefile.wim - editing to see if that fixes it.
    – user619818
    Commented Feb 22, 2018 at 13:31
  • Look you might be using an SSD, I just know that a 4 GB .wim image, which expands into 15-25 GB'ish Windows installation, takes awhile to apply to a mechanical drive. Which is the reason it takes several times longer than 8 minutes to install Windows. I realize in this case you are not mounting the image, transferring the contents to the drive, and then expanding the contents but what does happen should be taking longer then 8 minutes.
    – Ramhound
    Commented Feb 22, 2018 at 13:44
  • So you want to say that there should be a delay between image being applied and the rest of the commands ? That can be added with timeout.
    – Overmind
    Commented Feb 22, 2018 at 13:50

0

You must log in to answer this question.

Browse other questions tagged .