There are times when a preboot environment may have problems, but all other site servers may be fine. Some times, we don't want to rebuild on ALL of our site servers, either for testing purposes, or just troubleshooting. However, clicking "rebuild" in the console triggers a rebuild on every site server.
If you enable BootWiz logging on one of those site servers, you'll find the commands issued to BootWiz, similar to what shows up on my servers as follows:
2013/04/08 11:36:10 I: Command line: ' -quiet -pxe "WinPE_x86_PXE" -rootpath "C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\Task Handler\SBS\Images\WinPE_x86_PXE" -os "WinPE" -x86 "x86PC" -oem "DS" -create'
These two lines show up at the beginning of every run of BootWiz, and are changed periodically based on what you are trying to do (such as delete a config, or build an automation folder).
There are a few things to note here:
Option 1: Script Task using VBScript
The above text is pretty simple to put into a CMD script, but as you can see, it is highly specific for the system you run it on. This would require the use of Variables. There is a known issue with using Variables (system variables) in Command scripts (they don't work) so you can't define your own, though you could use tokens. This left the option of creating a BAT file (below) or doing it in VBS. The VBS option was far more complex, but is much more flexible for running on multiple systems. All you have to do is modify the menu, architecture, and PE version, and it will do the rest for you, including finding the installation, and inserting computer name and IP.
Copy the following text into a Run Script task set to VBScript. Recommended: set the advanced option to capture script output so that if you have a problem, we'll see why quickly.
' ------------------------------------------ '
' The following variables are controlled by you,
' to tell us what kind of menu we're rebuilding.
' Unfortunately, this can not be queried from the DB.
' ------------------------------------------ '
'
DIM vPXEMenu, vOSType, vArchType
vPXEMenu = "WinPE_x86_PXE"
vOSType = "WinPE" ' or LinPE
vArchType = "X86"
' ------------------------------------------ '
' The rest of this should not be modified.
' ------------------------------------------ '
'
DIM vDTHInstPath, vDPath, vFixBatPath, vDTHIPLen, vBWCmdP1, vBWCmdP2
vDPLen = Len(vDTHInstPath) - 22 ' The string contains the name of the DLL, and we just stripped that DLL name
vDPath = Left(vDTHInstPath, vDPLen)
vBWCmdP2 = """ -os """ & vOSType & """ -x86 """ & vArchType & "pc"" -oem ""DS"" -create"
vFixCmd = vFixBatPath & " ""PXENAME=%COMPNAME%"" ""PXEIP=%AGENTIPADDR%"" ""optPath=" & vPXEMenu & "\x86PC"" ""optName=" & vPXEMenu & """"
WshShell.run vBWCmdP1 & vBWCmdP2,0,True
'msgbox vFixCmd
WshShell.run vFixCmd,0,True
Option 2: Copy File task using a CMD Script
What I did for this particular preboot config was to create a Copy File Task, and a batch file with the following:
Set PXEMenu=WinPE_x86_PXE
"%DepPath%\Bootwiz\BootWiz.exe" -quiet -pxe %PXEMenu% -rootpath "%DepPath%\SBS\Images\%PXEMenu%" -os "WinPE" -x86 "x86PC" -oem "DS" -create
"%DepPath%\SBS\Images\%PXEMenu%\x86PC\pxefixup.bat" "PXENAME=SS4" "PXEIP=192.168.1.41" "optPath="%PXEMenu%\x86PC" "optName=%PXEMenu%"
The first 2 lines are to set some variables based on your image name and path. The 3rd line runs BootWiz, but will leave you with a dummy.0 file. The fourth line finishes it up then by creating the right .0 file.