We didn't have the problem with the hard drive being different but we ran into problems where the usb drive was a different drive letter in win pe /bart pe depending on what other usb devises were in use. Here is the bat file that we used to scan each drive for the location of the windrivers folder and then give it a name of BOOTDRIVE then we could call to the usb boot disk by name rather than drive letter.
Like Ghost32 -clone,mode=restore,src=%BOOTDRIVE%\xp\image.gho,dst=1 -batch -fx
In our ghost image we included a txt file called boot.txt and we did a scan of the drives after ghosting to identify the newly deployed image and properly run the ghost deployanywhere tools. Take a look below and modify as needed. You could use the same portion of the script to identify the hard drive if you know that the hard drive has a file or set of files already on all machines. simular to the boot.txt noted later in the script.
Eds suggestion is good to identify the usb drive also I just like the following command. It searches drive letter C to S for a folder of WINDRIVERS (this could be modifed for any folder or file) and then sets a windows variable name of BOOTDRIVE or any name that you like. You can then call to %yourvariable% in your batch file.
for %%f in (C D E F G H I J K L M N O P Q R S ) do if exist %%f:\WINDRIVERS\ set BOOTDRIVE=%%f:
Cheers.
@EcHO OFF
ClS
:: ######## BOOTDRIVE searching for the drive letter of the disk that was booted from with the windrivers folder.
for %%f in (C D E F G H I J K L M N O P Q R S ) do if exist %%f:\WINDRIVERS\ set BOOTDRIVE=%%f:
:: #################### MENU OPTIONS ###################
:MENU
cls
COLOR 1E
ECHO.
ECHO ___
ECHO _/ "\ 1 To deploy XP automagically
ECHO( \ ~/__ 2 This option is on back order check back soon
ECHO \ \__)3 To run Ghost32
ECHO / \ 4 To join a GhostCast session #1 automatic and then reboot
ECHO/ _\ 5 To quit and reboot
ECHO `"""""``
ECHO.
SET /P M=Select 1,-5 if you dare and press ENTER:
IF %M%==1 GOTO XP
IF %M%==2 GOTO VISTA
IF %M%==3 GOTO GHOST
IF %M%==4 GOTO Ghostcast
IF %M%==5 GOTO REBOOT
:: ######################################################
:: ################### Option 1 Start ###################
:: ######################################################
:: # 1 Deploy XP automagically
:: # 2 Run Deployanywhere
:: # 3 Run Ghostwalker
:: # 4 Rebooot
:XP
@cls
Echo Please Hold
:: #### 1 Deploy XP from \xp\image.gho to disk 1 ####
@%BOOTDRIVE%
@CD \GHOST
@Ghost32 -clone,mode=restore,src=%BOOTDRIVE%\xp\image.gho,dst=1 -batch -fx
:: #### 2 Run Deployanywhere ####
:: # OSDRIVE search for the boot.txt that must be in the root of the restored image.
@for %%f in (C D E F G H I J K L M N O P Q R S) do if exist %%f:\boot.txt set OSDRIVE=%%f:
Echo Please Hold
:: # Deployanywhere with the target of OSDRIVE
@cls
Echo Please Hold
@ghdplyaw32.exe /target=%OSDRIVE%\Windows /ddb=%BOOTDRIVE%\WINDRIVERS
@cls
Echo Please Hold
:: #### 3 Run Ghostwalker command
:: GhWalk32.exe /CN="PC<RANDOM_NUMERIC>" /batch
:: #### 4 Reboot using the Pe Reboot command
@cls
Please remove the USB drive.
@pause
@WPEUTIL Reboot
:: ######################################################
:: ################### Option 2 Start ###################
:: ######################################################
:: # 2 Deploy Vista automagically
:: # 3 Run Deployanywhere
:: # 4 Run Ghostwalker
:: # 5 Rebooot
:VISTA
@cls
ECHO This item is still on back order please check back soon.
Pause
GOTO :MENU
:: ######################################################
:: ################### Option 3 Start ###################
:: ######################################################
:: # 1 Start Ghost32.exe
:GHOST
:: #### 1 Start Ghost32.exe ####
@cls
Echo Please Hold
%BOOTDRIVE%
CD \GHOST
Ghost32.exe
:: ######################################################
:: ################### Option 4 Start ###################
:: ######################################################
:: # 1 Start Ghost32.exe and join session 1 Automatic
:: # 2 Reboot
:GHOSTcast
:: #### 1 Start Ghost32.exe ####
%BOOTDRIVE%
@CD \GHOST
@Ghost32.exe -ja=1 -sure
:: #### 2 Reboot using the Pe Reboot command ####
@cls
Please remove the USB drive.
@pause
@WPEUTIL Reboot
:: ######################################################
:: ################### Option 5 Start ###################
:: ######################################################
:: # 1 Reboot
:REBOOT
:: #### 1 Reboot using the Pe Reboot command ####
@cls
Please remove the USB drive.
@pause
@WPEUTIL Reboot