DS7.5 How to run BootWiz on a single Site Server via Task


Article ID: 181617


Updated On:


Deployment Solution




There are times when you may want, or need, to run or rerun BootWiz on a site server for a specific preboot configuration.  From the console, if you select "rebuild", all site servers rebuild at the same time, but maybe you only need to do so on one.  There are also times when BootWiz may not start automatically on it's own due to issues with the BootWiz package.

Regardless of the reason, here's a possible script you can configure to execute it manually.  Configure a Script task, using VBScript.  The advanced options can be left alone unless you're troubleshooting, and then you'll need to modify those to "run as currently logged on user" so you can see results.  For instance, we have some remarked prompts that will show you the lines being executed in case things don't work quite right, but you'll not see those (and should not expose them) unless the advanced option has been modified to run as the logged on user.  In general, you'll NOT want to do this, as there is usually no one logged on.  Remember as well to modify the required values at the top.  My PXE configuration is called "George" which I'm guessing is NOT yours...

' ------------------------------------------ '
' 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 = "George"
vOSType = "WinPE" ' or LinPE
vArchType = "X86" ' or X64

' ------------------------------------------ '
' The rest of this should not be modified.
' ------------------------------------------ '
DIM vDTHInstPath, vDPath, vFixBatPath, vDTHIPLen, vBWCmdP1, vBWCmdP2

Set WshShell = WScript.CreateObject("WScript.Shell")

vDTHInstPath = WshShell.RegRead("HKLM\SOFTWARE\Altiris\Altiris Agent\Plugin Objects\Agents\DeploymentNBSAgent\Install Path")
vDPLen = Len(vDTHInstPath) - 28 ' The string contains the name of the DLL, and we just stripped that DLL name
vDPath = Left(vDTHInstPath, vDPLen)

vBWCmdP1 = """" & vDPath & "\SBS\Bootwiz\{374E1C49-4F58-4F5C-8D51-07A30F0D44AD}\cache\bootwiz\BootWiz.exe"" -quiet -pxe " & vPXEMenu & " -rootpath """ & vDPath & "\SBS\Images\" & vPXEMenu
vBWCmdP2 = """ -os """ & vOSType & """ -x86 """ & vArchType & "pc"" -oem ""DS"" -create"

vFixBatPath = """" & vDPath & "\SBS\Images\" & vPXEMenu & "\" & vArchType & "PC\pxefixup.bat"""
'The following line is optional - to append options to PXEFixup.bat, which may not be necessary at all.
'vFixCmd = vFixBatPath & " ""PXENAME=%COMPNAME%"" ""PXEIP=%AGENTIPADDR%"" ""optPath=" & vPXEMenu & "\x86PC"" ""optName=" & vPXEMenu & """"

'msgbox vBWCmdP1 & vBWCmdP2
WshShell.run vBWCmdP1 & vBWCmdP2,0,True
'msgbox vFixBatPath
WshShell.run vFixBatPath,0,True

Alternatively, here is a CMD/BAT file you can configure to run stand-alone on a site server or the SMP that does essentially the same thing.  The path needs to be modified slightly depending on your installation environment.  The above script pulls these values from the registry and thus that is not needed.

@echo off
REM ==========================================================================
REM Script to create DS Preboot image.
REM Run on a NS machine with Deployment Solution installed.
REM Parameters
REM <PrebootName> <Image Destination path> <Windows|Linux>
REM ===========================================================================

set PrebootName=%1
set DestRoot=%2\Images
set Destination=%DestRoot%\%PrebootName%
set OS=%3
set BootWizPath=C:\Program Files\Altiris\Deployment\BDC\bootwiz

if not exist "%BootWizPath%" (
goto :eof

cd /d "%BootWizPath%"

if "%OS%" == "Windows" (
BootWiz.exe -quiet -pxe "%PrebootName%" -rootpath "%Destination%" -cfg "%BootWizPath%\WinPE\WinPE.cfg" -os "WinPE" -x86 "x86PC" -x64 "x64" -oem "DS"

cd /d "%Destination%\x86PC"
pxefixup.bat "pxePath=%DestRoot%" "optID=41" "optRID=41" "optPath=%PrebootName%\x86PC" "optName=%PrebootName%" "pxeName=" "pxeIP=" "dsName=" "dsIP=" "debug=t" "echo=t" > pxefixup.log

cd /d "%Destination%\x64"
pxefixup.bat "pxePath=%DestRoot%" "optID=41" "optRID=41" "optPath=%PrebootName%\x64" "optName=%PrebootName%" "pxeName=" "pxeIP=" "dsName=" "dsIP=" "debug=t" "echo=t" > pxefixup.log

) else (
BootWiz.exe -quiet -pxe "%PrebootName%" -rootpath "%Destination%" -os "Linux" -x86 "x86PC" -oem "DS"

 The above CMD script is designed to run manually (e.g. save as a stand-alone CMD file on the site server and run) with a few input parameters, as indicated. by the %1, %2, %3  in the SET statements.  Instructions are forthcoming.