Jump to content

2 partitions after restoring Image


Recommended Posts

Could you give me some more advise?

Yep, you are doing the same mistake I did, only the other way round. :D

IF NOT DEFINED \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

This is WRONG, the IF NOT DEFINED requires the variable NAME:

IF NOT DEFINED Image_naam GOTO :Loop

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

This is RIGHT, the IF NOT EXIST requires the filename, i.e. the EXPANDED variable.

jaclaz

Link to comment
Share on other sites


Could you give me some more advise?

Yep, you are doing the same mistake I did, only the other way round. :D

IF NOT DEFINED \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

This is WRONG, the IF NOT DEFINED requires the variable NAME:

IF NOT DEFINED Image_naam GOTO :Loop

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

This is RIGHT, the IF NOT EXIST requires the filename, i.e. the EXPANDED variable.

jaclaz

Could you please look at the code under here to see if there are errors, because nothing changed. He asks for a imagename, after i give in the imagename he gives me some text with paths and all kinds of things but brings back the question about imagename.

:itw7

diskpart /s diskw7.txt

net use \\server\reminst\images\windows7 /user:domain\administrator

SET Image_naam=

:Loop

SET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

IF NOT DEFINED Image_naam GOTO :Loop

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:

bcdboot.exe D:\Windows

goto end

Link to comment
Share on other sites

Could you please look at the code under here to see if there are errors, because nothing changed. He asks for a imagename, after i give in the imagename he gives me some text with paths and all kinds of things but brings back the question about imagename.

:itw7

diskpart /s diskw7.txt

net use \\server\reminst\images\windows7 /user:domain\administrator

SET Image_naam=

:Loop

SET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

IF NOT DEFINED Image_naam GOTO :Loop

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:

bcdboot.exe D:\Windows

goto end

As said, try REMming out the checks AND add a PAUSE:

:itw7

diskpart /s diskw7.txt

net use \\server\reminst\images\windows7 /user:domain\administrator

SET Image_naam=

:Loop

SET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

PAUSE

REM IF NOT DEFINED Image_naam GOTO :Loop

REM IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

IF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINED) ELSE (ECHO Image_naam is %Image_naam%)

PAUSE

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT exist) ELSE (ECHO Image_naam FOUND: %Image_naam%)

PAUSE

START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:

PAUSE

bcdboot.exe D:\Windows

goto end

and post what happens. :unsure:

jaclaz

Link to comment
Share on other sites

Jaclaz,

He asks for a image name

then a bunch of text with paths appears.

after the pause press any key he gives the text: Image_naam is NOT DEFINED

press any key to continue...

Image_naam FOUND:

Press any key to continue...

Press any key to continue...

bcdboot.exe is not recognized....

reboot

I seems that he cannot find the image name. But i have double chequed the name and it seems ok. The name of the image is in the share:

\\server\reminst\images\windows7\DATACLIENT.wim

I have also tried to put the full path after he asks for the image_naam: \\server\reminst\images\windows7\DATACLIENT.wim

Link to comment
Share on other sites

I seems that he cannot find the image name.

Hmmm, not really:

He asks for a image name

then a bunch of text with paths appears.

after the pause press any key he gives the text: Image_naam is NOT DEFINED

press any key to continue...

Image_naam FOUND:

Press any key to continue...

Press any key to continue...

bcdboot.exe is not recognized....

reboot

I see now what the problem is. :)

What I posted originally:

SET /P Image_name=Please Enter name of the image including the .wim extension

What you actually wrote:

SET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie

:whistle:

Try again, COPY and PASTE:

:itw7

diskpart /s diskw7.txt

net use \\server\reminst\images\windows7 /user:domain\administrator

SET Image_naam=

:Loop

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

PAUSE

REM IF NOT DEFINED Image_naam GOTO :Loop

REM IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

IF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINED) ELSE (ECHO Image_naam is %Image_naam%)

PAUSE

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT exist) ELSE (ECHO Image_naam FOUND: %Image_naam%)

PAUSE

START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:

PAUSE

bcdboot.exe D:\Windows

goto end

The "bcdboot.exe not recognized" is another problem, most probably you have to supply the full path to the bcdboot.exe file.

jaclaz

Link to comment
Share on other sites

I seems that he cannot find the image name.

Hmmm, not really:

He asks for a image name

then a bunch of text with paths appears.

after the pause press any key he gives the text: Image_naam is NOT DEFINED

press any key to continue...

Image_naam FOUND:

Press any key to continue...

Press any key to continue...

bcdboot.exe is not recognized....

reboot

I see now what the problem is. :)

What I posted originally:

SET /P Image_name=Please Enter name of the image including the .wim extension

What you actually wrote:

SET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie

:whistle:

Try again, COPY and PASTE:

:itw7

diskpart /s diskw7.txt

net use \\server\reminst\images\windows7 /user:domain\administrator

SET Image_naam=

:Loop

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

PAUSE

REM IF NOT DEFINED Image_naam GOTO :Loop

REM IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

IF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINED) ELSE (ECHO Image_naam is %Image_naam%)

PAUSE

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT exist) ELSE (ECHO Image_naam FOUND: %Image_naam%)

PAUSE

START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:

PAUSE

bcdboot.exe D:\Windows

goto end

The "bcdboot.exe not recognized" is another problem, most probably you have to supply the full path to the bcdboot.exe file.

jaclaz

It looked almost that it worked but then something went wrong again.

He asks for the image_name

After filling in the Image name (dataclient.wim) he respons:

Environment variable dataclient.wim not defined

Link to comment
Share on other sites

I seems that he cannot find the image name.

Hmmm, not really:

He asks for a image name

then a bunch of text with paths appears.

after the pause press any key he gives the text: Image_naam is NOT DEFINED

press any key to continue...

Image_naam FOUND:

Press any key to continue...

Press any key to continue...

bcdboot.exe is not recognized....

reboot

I see now what the problem is. :)

What I posted originally:

SET /P Image_name=Please Enter name of the image including the .wim extension

What you actually wrote:

SET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie

:whistle:

Try again, COPY and PASTE:

:itw7

diskpart /s diskw7.txt

net use \\server\reminst\images\windows7 /user:domain\administrator

SET Image_naam=

:Loop

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

PAUSE

REM IF NOT DEFINED Image_naam GOTO :Loop

REM IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :Loop

IF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINED) ELSE (ECHO Image_naam is %Image_naam%)

PAUSE

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT exist) ELSE (ECHO Image_naam FOUND: %Image_naam%)

PAUSE

START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:

PAUSE

bcdboot.exe D:\Windows

goto end

The "bcdboot.exe not recognized" is another problem, most probably you have to supply the full path to the bcdboot.exe file.

jaclaz

It looked almost that it worked but then something went wrong again.

He asks for the image_name

After filling in the Image name (dataclient.wim) he respons:

Environment variable dataclient.wim not defined

Image_name is dataclient.wim

Image_name FOUND: dataclient.wim

Then he is scrolling many screens with text (this could be the image restore, that also give a lot of scrolling text at the beginning).

But then he stops and starts the bcd error, and restarts the system.

Edited by surfertje
Link to comment
Share on other sites

It looked almost that it worked but then something went wrong again.

He asks for the image_name

After filling in the Image name (dataclient.wim) he respons:

Environment variable dataclient.wim not defined

Image_name is dataclient.wim

Image_name FOUND: dataclient.wim

Then he is scrolling many screens with text (this could be the image restore, that also give a lot of scrolling text at the beginning).

But then he stops and starts the bcd error, and restarts the system.

The "bcdboot.exe not recognized" is another problem, most probably you have to supply the full path to the bcdboot.exe file.

Add a 5th PAUSE statement right after the bootbcd command:

bcdboot.exe D:\Windows

PAUSE

goto end

and post the actual error you get.

jaclaz

Link to comment
Share on other sites

It looked almost that it worked but then something went wrong again.

He asks for the image_name

After filling in the Image name (dataclient.wim) he respons:

Environment variable dataclient.wim not defined

Image_name is dataclient.wim

Image_name FOUND: dataclient.wim

Then he is scrolling many screens with text (this could be the image restore, that also give a lot of scrolling text at the beginning).

But then he stops and starts the bcd error, and restarts the system.

The "bcdboot.exe not recognized" is another problem, most probably you have to supply the full path to the bcdboot.exe file.

Add a 5th PAUSE statement right after the bootbcd command:

bcdboot.exe D:\Windows

PAUSE

goto end

and post the actual error you get.

jaclaz

I have run the commands again and saw the following:

give image name incl wim extensie:

after giving the name respons: envrionment variable dataclient.wim not defined

press any key

Image_naam is dataclient.wim

press any key

Image_naam FOUND: dtaclient.wim

press any key

The image is starting, i can see that seeing a progress bar fast, the the scrolling windows, but this is due to restoring Windows 7, this wasn't by restoring Windows xp images.

Then on the end of the scrolling Windows see: wimcopyfile.exe failed

the screens go away and:

press any key to continue appears

then the bcdboot command comes and the error is: command is not recognized as a in- external command

Link to comment
Share on other sites

Some extra info:

I have changed the command imagex /apply from C to D:. He is now restoring the image (that is he is progressing at 2%)

The batch is still displaying the NON DEFINED error and the bcdboot is still not working but that is because the image is not yet restored i believe. But must i then start bcdboot from the D so d:\windows\system32\bcdboot of just bcdboot?

Link to comment
Share on other sites

Cannot say about the "wimcopyfile.exe failed"

The batch is still displaying the NON DEFINED error

That's not a problem.

Simply change:

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

PAUSE

to:

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

SET Image_naam

PAUSE

or remove the two lines (they were just a check):

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

PAUSE

i.e.this is the "semi-final" version:

:itw7

diskpart /s diskw7.txt

net use \\server\reminst\images\windows7 /user:domain\administrator

SET Image_naam=

:Loop

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

IF NOT DEFINED Image_naam (

ECHO Image_naam is NOT DEFINED

PAUSE

GOTO :Loop

) ELSE (

ECHO Image_naam is %Image_naam%

)

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (

ECHO Image_naam does NOT exist

PAUSE

GOTO :Loop

) ELSE (

ECHO Image_naam FOUND: %Image_naam%

)

START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 d:

PAUSE

bcdboot.exe D:\Windows

PAUSE

goto end

and once you have it woreking you can remove also the red PAUSE's.

and the bcdboot is still not working but that is because the image is not yet restored i believe. But must i then start bcdboot from the D so d:\windows\system32\bcdboot of just bcdboot?

The "command is not recognized as a in- external command", as now said for the 3rd (THIRD) time :w00t: is because the executable named "bcdboot.exe" is NOT found in the current directory NOR in the current PATH.

You need to EITHER:

  • add the path where "bcdboot.exe" is to the PATH variable
  • copy the "bcdboot.exe" in the working directory of the batch
  • change the batch to include the FULL path to the "bcdboot.exe" file. something like:
    \\server\reminst\images\windows7\bcdboot.exe D:\Windows


    or:

    D:\Windows\system32\bcdboot.exe D:\Windows


Remember that the general idea is to help you learning how to write your own batches, not that of writing them for you, you need some patience and trial and error, but you also need some time to try understanding WHAT the batch commands do and introduce your own checks.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Cannot say about the "wimcopyfile.exe failed"

The batch is still displaying the NON DEFINED error

That's not a problem.

Simply change:

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

PAUSE

to:

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

SET Image_naam

PAUSE

or remove the two lines (they were just a check):

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

SET %Image_naam%

PAUSE

i.e.this is the "semi-final" version:

:itw7

diskpart /s diskw7.txt

net use \\server\reminst\images\windows7 /user:domain\administrator

SET Image_naam=

:Loop

SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie

IF NOT DEFINED Image_naam (

ECHO Image_naam is NOT DEFINED

PAUSE

GOTO :Loop

) ELSE (

ECHO Image_naam is %Image_naam%

)

IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (

ECHO Image_naam does NOT exist

PAUSE

GOTO :Loop

) ELSE (

ECHO Image_naam FOUND: %Image_naam%

)

START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 d:

PAUSE

bcdboot.exe D:\Windows

PAUSE

goto end

and once you have it woreking you can remove also the red PAUSE's.

and the bcdboot is still not working but that is because the image is not yet restored i believe. But must i then start bcdboot from the D so d:\windows\system32\bcdboot of just bcdboot?

The "command is not recognized as a in- external command", as now said for the 3rd (THIRD) time :w00t: is because the executable named "bcdboot.exe" is NOT found in the current directory NOR in the current PATH.

You need to EITHER:

  • add the path where "bcdboot.exe" is to the PATH variable
  • copy the "bcdboot.exe" in the working directory of the batch
  • change the batch to include the FULL path to the "bcdboot.exe" file. something like:
    \\server\reminst\images\windows7\bcdboot.exe D:\Windows


    or:

    D:\Windows\system32\bcdboot.exe D:\Windows


Remember that the general idea is to help you learning how to write your own batches, not that of writing them for you, you need some patience and trial and error, but you also need some time to try understanding WHAT the batch commands do and introduce your own checks.

jaclaz

Thanks alot, it works perfect!

I have tested it and there where no errors. Now i gonna try to understand what you have told me about the batchfiles.

And i am gonna post a new question on this forum for a another problem i am struggling for days now about the copyprofile in MDT2010.

Again, youve been a great help.

Link to comment
Share on other sites

Thanks alot, it works perfect!

I have tested it and there where no errors. Now i gonna try to understand what you have told me about the batchfiles.

And i am gonna post a new question on this forum for a another problem i am struggling for days now about the copyprofile in MDT2010.

Again, youve been a great help.

Only too happy of having contributed to another happy bunny:

http://www.msfn.org/board/index.php?showtopic=128727&st=10

:)

jaclaz

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...