surfertje Posted June 18, 2010 Share Posted June 18, 2010 How can i automize a bcdboot command when booting the client with USB Winpe Stick?One is to make a .txt file where i create 2 partitions with the letters c and d. after creating this paritions and after restoring a image the command in the Windows\system32\bcdboot.exe d:\Windows must be given. This works i have tested it but how can i do this automatically? The diskpart i do automatically to call a txt file disk.txt with the diskpart /s command. POutting this in the startnet.cmd then it is solved. In MDT2010 is doesn't have to be solved because he makes that extra partition and takes care of Windows 7 booting partition but when i boot from USB stick then i must solve it as mentioned with startnet and disk.txt. But how do i automate the bcdboot command? so that i do not run this command when i restore a image thru the usb boot winpe stick? Link to comment Share on other sites More sharing options...
Tripredacus Posted June 18, 2010 Share Posted June 18, 2010 With your diskpart script, you still create the System partition, but do not assign it a drive letter. Assign C: to your OS partition. Then run BCDBOOT C:\Windows. How are you currently scripting your install? Link to comment Share on other sites More sharing options...
surfertje Posted June 21, 2010 Author Share Posted June 21, 2010 With your diskpart script, you still create the System partition, but do not assign it a drive letter. Assign C: to your OS partition. Then run BCDBOOT C:\Windows. How are you currently scripting your install?I have a startnet.cmd on the usb key so there appears a menu when bootting with usb stick in Winpe. Then when i choose a menu option like restore image off... then diskpart.txt is run to format the harddrive and making the partitions.The question now is how to automate the bcdboot command, i cannot put it in the diskpart.txt? Link to comment Share on other sites More sharing options...
jaclaz Posted June 21, 2010 Share Posted June 21, 2010 The question now is how to automate the bcdboot command, i cannot put it in the diskpart.txt?No, but you can put it in StartNet.cmd, after the part invoking diskpart.OT, but not much , if you want to "embed" the diskpart.txt into a batch looky here:http://www.msfn.org/board/index.php?showtopic=126069&st=19this way from startnet.cmd you can invoke another batch that contains BOTH the diskpart and the BCDBOOT commands. jaclaz Link to comment Share on other sites More sharing options...
surfertje Posted June 21, 2010 Author Share Posted June 21, 2010 The question now is how to automate the bcdboot command, i cannot put it in the diskpart.txt?No, but you can put it in StartNet.cmd, after the part invoking diskpart.OT, but not much , if you want to "embed" the diskpart.txt into a batch looky here:http://www.msfn.org/board/index.php?showtopic=126069&st=19this way from startnet.cmd you can invoke another batch that contains BOTH the diskpart and the BCDBOOT commands. jaclazThx. But this looks very complicated. I have put this in my startnet.cmd::itw7diskpart /s diskw7.txtecho VOORBEELD: imagex /apply \\server\reminst\images\windows7\NAAM.wim 1 c:bcdboot.exe D:\Windowsbcdboot.exe D:\Windowsgoto endHowever: in this way the bcdboot runs to fust because the image must be restored first before the bcdboot command. Can you give me a some what easyer example how i can put this in startnetcmd? Link to comment Share on other sites More sharing options...
jaclaz Posted June 21, 2010 Share Posted June 21, 2010 However: in this way the bcdboot runs to fust because the image must be restored first before the bcdboot command. Can you give me a some what easyer example how i can put this in startnetcmd?You can use START "A_title" /WAIT imagex /apply \\server\reminst\images\windows7\NAAM.wim 1 c:http://ss64.com/nt/start.htmlbut cannot say if something needs to be "refreshed" after applying an image,, maybe you need to add an additional "delay" or "timeout" or "wait" command, such as sleep.exe or similar:http://www.911cd.net/forums/index.php?showtopic=3252&st=9to give the OS the "time" to see that the image has been applied.jaclaz Link to comment Share on other sites More sharing options...
surfertje Posted June 21, 2010 Author Share Posted June 21, 2010 However: in this way the bcdboot runs to fust because the image must be restored first before the bcdboot command. Can you give me a some what easyer example how i can put this in startnetcmd?You can use START "A_title" /WAIT imagex /apply \\server\reminst\images\windows7\NAAM.wim 1 c:http://ss64.com/nt/start.htmlbut cannot say if something needs to be "refreshed" after applying an image,, maybe you need to add an additional "delay" or "timeout" or "wait" command, such as sleep.exe or similar:http://www.911cd.net/forums/index.php?showtopic=3252&st=9to give the OS the "time" to see that the image has been applied.jaclazThe problem is that the imagex command cannot run automatically. This command i must put manually because the name is different every time. I restore different images with different names.Is it possible to show the menu in startnet.cmd then choosing a menu option from startnet which wil go to the :itw7 commands and then give in the imagex command manually, then when he is finished he jumps to another command in the startnet.cmd which starts the bcdboot (so after the imagex /apply command is manually given?) Link to comment Share on other sites More sharing options...
jaclaz Posted June 21, 2010 Share Posted June 21, 2010 Oww, comeon :SET Image_name=:LoopSET /P Image_name=Please Enter name of the image including the .wim extension IF NOT DEFINED Image_name GOTO :LoopIF NOT EXIST Image_name GOTO :LoopSTART "A_title" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_name% 1 c:bcdboot.exe D:\Windowsjaclaz Link to comment Share on other sites More sharing options...
surfertje Posted June 21, 2010 Author Share Posted June 21, 2010 Oww, comeon :SET Image_name=:LoopSET /P Image_name=Please Enter name of the image including the .wim extension IF NOT DEFINED Image_name GOTO :LoopIF NOT EXIST Image_name GOTO :LoopSTART "A_title" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_name% 1 c:bcdboot.exe D:\WindowsjaclazThis is looking nice i have two final questions:c:bcdboot.exe d:\windows For me this must be i think: x:\windows\system32\bcdboot.exe d:\windowsWhat must i fill in by: "a title"? Link to comment Share on other sites More sharing options...
jaclaz Posted June 21, 2010 Share Posted June 21, 2010 c:bcdboot.exe d:\windows For me this must be i think: x:\windows\system32\bcdboot.exe d:\windowsProbably no, cannot say if in the booted PE "x:\windows\system32\" is already in PATH , but I presume it is.What must i fill in by: "a title"?Try with:"Next time I will read given links" http://ss64.com/nt/start.htmlNotes:Always include a TITLE this can be a simple string like "My Script" or just a pair of empty quotes ""According to the Microsoft documentation, the title is optional, but you may have problems if it is omitted.jaclaz Link to comment Share on other sites More sharing options...
surfertje Posted June 22, 2010 Author Share Posted June 22, 2010 c:bcdboot.exe d:\windows For me this must be i think: x:\windows\system32\bcdboot.exe d:\windowsProbably no, cannot say if in the booted PE "x:\windows\system32\" is already in PATH , but I presume it is.What must i fill in by: "a title"?Try with:"Next time I will read given links" http://ss64.com/nt/start.htmlNotes:Always include a TITLE this can be a simple string like "My Script" or just a pair of empty quotes ""According to the Microsoft documentation, the title is optional, but you may have problems if it is omitted.jaclazYes i must do that am sorry?But now the last question: is the start and the /wait command nessecairy? I can run imagex without it? Link to comment Share on other sites More sharing options...
jaclaz Posted June 22, 2010 Share Posted June 22, 2010 But now the last question: is the start and the /wait command nessecairy? I can run imagex without it?You'll have to do some experiments, there are a number of factors that can influence the way an invoked app will run, including the particular subset you are running (PE 3.x).Using the Start /wait you are guranteed that the next BCDboot command will NOT be executed until the imagex has completed, as said, since it is likely that there will be timing problems, it is very possible that in ADDITION to the start /wait you will need to insert a command to have some small delay between the imagex and the bootbcd commands.The only way to know is to experiment:Life is "trying things to see if they work" jaclaz Link to comment Share on other sites More sharing options...
surfertje Posted June 23, 2010 Author Share Posted June 23, 2010 Oww, comeon :SET Image_name=:LoopSET /P Image_name=Please Enter name of the image including the .wim extension IF NOT DEFINED Image_name GOTO :LoopIF NOT EXIST Image_name GOTO :LoopSTART "A_title" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_name% 1 c:bcdboot.exe D:\WindowsjaclazThis is looking nice i have two final questions:c:bcdboot.exe d:\windows For me this must be i think: x:\windows\system32\bcdboot.exe d:\windowsWhat must i fill in by: "a title"?I have a problem to get this to work. The code above stays in a loop. I do a netuse before running the above code to the share where the image's are. The he asks for a image name incl .wim extension. When i fill in the name he keeps asking for the .wim file so he is in a :loop. The name for the image is correct, the share netuse is completed successfully. I have placed the :loop before SET Image_name= because i thought that could be the problem, but it aint.What can be more wrong? Link to comment Share on other sites More sharing options...
jaclaz Posted June 23, 2010 Share Posted June 23, 2010 (edited) I have a problem to get this to work. The code above stays in a loop. I do a netuse before running the above code to the share where the image's are. The he asks for a image name incl .wim extension. When i fill in the name he keeps asking for the .wim file so he is in a :loop. The name for the image is correct, the share netuse is completed successfully. I have placed the :loop before SET Image_name= because i thought that could be the problem, but it aint.What can be more wrong?Well, you'll have to find out, try doing the obvious things:SET Image_name= :Loop SET /P Image_name=Please Enter name of the image including the .wim extension PAUSESET %Image_name%REM IF NOT DEFINED Image_name GOTO :Loop REM IF NOT EXIST Image_name GOTO :Loop ECHO START "A_title" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_name% 1 c: PAUSESTART "A_title" /WAIT imagex /apply \\server\reminst\images\windows7\%Image_name% 1 c: bcdboot.exe D:\Windows Edit:Sorry, my bad , there was a typo in:IF NOT EXIST Image_name GOTO :Loopit should be (obviously):IF NOT EXIST %Image_name% GOTO :Loop and you may also need to change it to the "Full" path:IF NOT EXIST \\server\reminst\images\windows7\%Image_name% GOTO :Loop jaclaz Edited June 23, 2010 by jaclaz Link to comment Share on other sites More sharing options...
surfertje Posted June 23, 2010 Author Share Posted June 23, 2010 I would like that this is succeeding. This is what i have in my startnet.cmd:diskpart /s diskw7.txtnet use \\server\reminst\images\windows7 /user:domain\loginnameSET Image_naam=:LoopSET /P %Image_naam%=Geef de naam in van de Image inclusief .wim extensie SET %Image_naam%IF NOT DEFINED \\server\reminst\images\windows7\%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 endThe first command (net use) is succesfully.After the set image_naam there is also no error.Then this appears: Geef de naam in van de Image inclusief .wim extensie (= the set /p command)After this he gives me a screen of text with computername, processorlevel, path and temp paths etc etc. Then the screen is appearing again:Geef de naam in van de Image inclusief .wim extensie And it starts over.Could you give me some more advise? 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