jaclaz Posted June 23, 2010 Share Posted June 23, 2010 Could you give me some more advise?Yep, you are doing the same mistake I did, only the other way round. IF NOT DEFINED \\server\reminst\images\windows7\%Image_naam% GOTO :LoopThis is WRONG, the IF NOT DEFINED requires the variable NAME:IF NOT DEFINED Image_naam GOTO :LoopIF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :LoopThis is RIGHT, the IF NOT EXIST requires the filename, i.e. the EXPANDED variable.jaclaz Link to comment Share on other sites More sharing options...
surfertje Posted June 29, 2010 Author Share Posted June 29, 2010 Could you give me some more advise?Yep, you are doing the same mistake I did, only the other way round. IF NOT DEFINED \\server\reminst\images\windows7\%Image_naam% GOTO :LoopThis is WRONG, the IF NOT DEFINED requires the variable NAME:IF NOT DEFINED Image_naam GOTO :LoopIF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :LoopThis is RIGHT, the IF NOT EXIST requires the filename, i.e. the EXPANDED variable.jaclazCould 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.:itw7diskpart /s diskw7.txtnet use \\server\reminst\images\windows7 /user:domain\administratorSET Image_naam=:LoopSET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie SET %Image_naam%IF NOT DEFINED Image_naam GOTO :LoopIF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :LoopSTART "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:bcdboot.exe D:\Windowsgoto end Link to comment Share on other sites More sharing options...
jaclaz Posted June 29, 2010 Share Posted June 29, 2010 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.:itw7diskpart /s diskw7.txtnet use \\server\reminst\images\windows7 /user:domain\administratorSET Image_naam=:LoopSET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie SET %Image_naam%IF NOT DEFINED Image_naam GOTO :LoopIF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :LoopSTART "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:bcdboot.exe D:\Windowsgoto endAs said, try REMming out the checks AND add a PAUSE::itw7diskpart /s diskw7.txtnet use \\server\reminst\images\windows7 /user:domain\administratorSET Image_naam=:LoopSET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie SET %Image_naam%PAUSEREM IF NOT DEFINED Image_naam GOTO :LoopREM IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :LoopIF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINED) ELSE (ECHO Image_naam is %Image_naam%)PAUSEIF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT exist) ELSE (ECHO Image_naam FOUND: %Image_naam%)PAUSESTART "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:PAUSEbcdboot.exe D:\Windowsgoto endand post what happens. jaclaz Link to comment Share on other sites More sharing options...
surfertje Posted June 30, 2010 Author Share Posted June 30, 2010 Jaclaz,He asks for a image namethen a bunch of text with paths appears.after the pause press any key he gives the text: Image_naam is NOT DEFINEDpress any key to continue...Image_naam FOUND:Press any key to continue...Press any key to continue...bcdboot.exe is not recognized....rebootI 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.wimI 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 More sharing options...
jaclaz Posted June 30, 2010 Share Posted June 30, 2010 I seems that he cannot find the image name.Hmmm, not really:He asks for a image namethen a bunch of text with paths appears.after the pause press any key he gives the text: Image_naam is NOT DEFINEDpress any key to continue...Image_naam FOUND:Press any key to continue...Press any key to continue...bcdboot.exe is not recognized....rebootI 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 Try again, COPY and PASTE::itw7diskpart /s diskw7.txtnet use \\server\reminst\images\windows7 /user:domain\administratorSET Image_naam=:LoopSET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie SET %Image_naam%PAUSEREM IF NOT DEFINED Image_naam GOTO :LoopREM IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :LoopIF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINED) ELSE (ECHO Image_naam is %Image_naam%)PAUSEIF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT exist) ELSE (ECHO Image_naam FOUND: %Image_naam%)PAUSESTART "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:PAUSEbcdboot.exe D:\Windowsgoto endThe "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 More sharing options...
surfertje Posted June 30, 2010 Author Share Posted June 30, 2010 I seems that he cannot find the image name.Hmmm, not really:He asks for a image namethen a bunch of text with paths appears.after the pause press any key he gives the text: Image_naam is NOT DEFINEDpress any key to continue...Image_naam FOUND:Press any key to continue...Press any key to continue...bcdboot.exe is not recognized....rebootI 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 Try again, COPY and PASTE::itw7diskpart /s diskw7.txtnet use \\server\reminst\images\windows7 /user:domain\administratorSET Image_naam=:LoopSET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie SET %Image_naam%PAUSEREM IF NOT DEFINED Image_naam GOTO :LoopREM IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :LoopIF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINED) ELSE (ECHO Image_naam is %Image_naam%)PAUSEIF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT exist) ELSE (ECHO Image_naam FOUND: %Image_naam%)PAUSESTART "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:PAUSEbcdboot.exe D:\Windowsgoto endThe "bcdboot.exe not recognized" is another problem, most probably you have to supply the full path to the bcdboot.exe file. jaclazIt looked almost that it worked but then something went wrong again.He asks for the image_nameAfter filling in the Image name (dataclient.wim) he respons:Environment variable dataclient.wim not defined Link to comment Share on other sites More sharing options...
surfertje Posted June 30, 2010 Author Share Posted June 30, 2010 (edited) I seems that he cannot find the image name.Hmmm, not really:He asks for a image namethen a bunch of text with paths appears.after the pause press any key he gives the text: Image_naam is NOT DEFINEDpress any key to continue...Image_naam FOUND:Press any key to continue...Press any key to continue...bcdboot.exe is not recognized....rebootI 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 Try again, COPY and PASTE::itw7diskpart /s diskw7.txtnet use \\server\reminst\images\windows7 /user:domain\administratorSET Image_naam=:LoopSET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie SET %Image_naam%PAUSEREM IF NOT DEFINED Image_naam GOTO :LoopREM IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% GOTO :LoopIF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINED) ELSE (ECHO Image_naam is %Image_naam%)PAUSEIF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT exist) ELSE (ECHO Image_naam FOUND: %Image_naam%)PAUSESTART "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 c:PAUSEbcdboot.exe D:\Windowsgoto endThe "bcdboot.exe not recognized" is another problem, most probably you have to supply the full path to the bcdboot.exe file. jaclazIt looked almost that it worked but then something went wrong again.He asks for the image_nameAfter filling in the Image name (dataclient.wim) he respons:Environment variable dataclient.wim not definedImage_name is dataclient.wimImage_name FOUND: dataclient.wimThen 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 June 30, 2010 by surfertje Link to comment Share on other sites More sharing options...
jaclaz Posted June 30, 2010 Share Posted June 30, 2010 It looked almost that it worked but then something went wrong again.He asks for the image_nameAfter filling in the Image name (dataclient.wim) he respons:Environment variable dataclient.wim not definedImage_name is dataclient.wimImage_name FOUND: dataclient.wimThen 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:\WindowsPAUSEgoto endand post the actual error you get.jaclaz Link to comment Share on other sites More sharing options...
surfertje Posted June 30, 2010 Author Share Posted June 30, 2010 It looked almost that it worked but then something went wrong again.He asks for the image_nameAfter filling in the Image name (dataclient.wim) he respons:Environment variable dataclient.wim not definedImage_name is dataclient.wimImage_name FOUND: dataclient.wimThen 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:\WindowsPAUSEgoto endand post the actual error you get.jaclazI 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 definedpress any keyImage_naam is dataclient.wimpress any keyImage_naam FOUND: dtaclient.wimpress any keyThe 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 failedthe screens go away and:press any key to continue appearsthen the bcdboot command comes and the error is: command is not recognized as a in- external command Link to comment Share on other sites More sharing options...
surfertje Posted June 30, 2010 Author Share Posted June 30, 2010 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 More sharing options...
jaclaz Posted June 30, 2010 Share Posted June 30, 2010 (edited) 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%PAUSEto:SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie SET Image_naamPAUSEor 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%PAUSEi.e.this is the "semi-final" version::itw7diskpart /s diskw7.txtnet use \\server\reminst\images\windows7 /user:domain\administratorSET Image_naam=:LoopSET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie IF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINEDPAUSEGOTO :Loop) ELSE (ECHO Image_naam is %Image_naam%)IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT existPAUSEGOTO :Loop) ELSE (ECHO Image_naam FOUND: %Image_naam%)START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 d:PAUSEbcdboot.exe D:\WindowsPAUSEgoto endand 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 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 variablecopy the "bcdboot.exe" in the working directory of the batchchange the batch to include the FULL path to the "bcdboot.exe" file. something like:\\server\reminst\images\windows7\bcdboot.exe D:\Windowsor:D:\Windows\system32\bcdboot.exe D:\WindowsRemember 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 June 30, 2010 by jaclaz Link to comment Share on other sites More sharing options...
surfertje Posted July 1, 2010 Author Share Posted July 1, 2010 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%PAUSEto:SET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie SET Image_naamPAUSEor 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%PAUSEi.e.this is the "semi-final" version::itw7diskpart /s diskw7.txtnet use \\server\reminst\images\windows7 /user:domain\administratorSET Image_naam=:LoopSET /P Image_naam=Geef de naam in van de Image inclusief .wim extensie IF NOT DEFINED Image_naam (ECHO Image_naam is NOT DEFINEDPAUSEGOTO :Loop) ELSE (ECHO Image_naam is %Image_naam%)IF NOT EXIST \\server\reminst\images\windows7\%Image_naam% (ECHO Image_naam does NOT existPAUSEGOTO :Loop) ELSE (ECHO Image_naam FOUND: %Image_naam%)START "start" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_naam% 1 d:PAUSEbcdboot.exe D:\WindowsPAUSEgoto endand 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 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 variablecopy the "bcdboot.exe" in the working directory of the batchchange the batch to include the FULL path to the "bcdboot.exe" file. something like:\\server\reminst\images\windows7\bcdboot.exe D:\Windowsor:D:\Windows\system32\bcdboot.exe D:\WindowsRemember 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.jaclazThanks 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 More sharing options...
jaclaz Posted July 1, 2010 Share Posted July 1, 2010 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=10jaclaz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now