Hi All, thanks for the help. I have actually managed to find a solution. As Lonkero suggested the local hard disk is being erased every month and replaced with the production Citrix Server image, which also seems to change every month as we add more applications to the servers.

Writing a file to the floppy was also not an option as we are using the Compaq Remote Insite Board to insert a "Virtual Floppy" remotely, reboot the server and boot from the floppy image. This is fantastic technology as it means that I can reimage all four of our server farms without leaving my desk [Smile] Unfortunately when you write to the virtual floppy the changes are lost when the machine is rebooted.

Anyway, I have managed to get a script running that loads the TCP/IP stack with an IP Address of 192.168.0.1, read the @ADDRESS macro, unload TCP/IP, update the IP Address to a pre-determined one from a text file, reload TCP/IP and then multicast the image to all of the servers.

UNLOADT is the exe that unloads TCP/IP from memory.

Here is the Autoexec.BAT that starts the whole process:

code:
@echo off

path=a:\net;a:\dos;A:\

COPY A:\Net\Protocol.DEF A:\Net\Protocol.INI
COPY A:\Net\System.DEF A:\Net\System.INI

net initialize
netbind.com
umb.com
tcptsr.exe
tinyrfc.exe

KIX16 BOOT.KIX

unloadt.exe
tcptsr.exe
tinyrfc.eee

nmtsr.exe
emsbfr.exe
mouse
keyb UK
doskey

A:\IMAGES.BAT

Here is Boot.KIX:

code:
$ServerIniFile='A:\Servers.INI'
$ProtocolIniFile='A:\Net\Protocol.INI'
$SystemIniFile='A:\Net\System.INI'

SHELL 'COMMAND /C DEL A:\Images.BAT'

$FileName=$ServerIniFile
$Section='MACAddress'
$Key='@ADDRESS'

CALL 'ReadINI.KIX'

IF $Value<>'**Not Found**'
$MacComputerName=$Value
ELSE
$MacComputerName=''
ENDIF

$FoundComputerName=0

WHILE $FoundComputerName=0
CLS
?
? ' ****************************************************************'
? ' * *'
? ' * Generic Citrix Server Network Boot Disk *'
? ' * --------------------------------------- *'
? ' * *'
? ' * This boot disk will load dos network drivers in order to *'
? ' * connect to a network share and reimage the Citrix server *'
? ' * *'
? ' * All IP information is saved in *'
? ' *'
$Space=62-LEN($ServerINIFile)
$SpaceL=$Space/2
$SpaceR=$Space-$SpaceL
WHILE $SpaceL>0
' ' $SpaceL=$SpaceL-1
LOOP
$ServerIniFile
WHILE $SpaceR>0
' ' $SpaceR=$SpaceR-1
LOOP
'*'
? ' * *'
? ' ****************************************************************'
?
? ' MAC Address is: @ADDRESS'
? ?
IF $MacComputerName=''
' Server Name: '
ELSE
$Space=21-LEN($MacComputerName)
WHILE $Space>0
' ' $Space=$Space-1
LOOP
'Server Name [$MacComputerName]: '
ENDIF
GETS $ComputerName
IF $ComputerName='' AND $MacComputerName<>''
$ComputerName=$MacComputerName
ENDIF
IF $ComputerName<>''
IF SUBSTR($ComputerName,12,1)='X'
$Island='TestLab'
ELSE
$Island=SUBSTR($ComputerName,3,6)+'Common'
ENDIF
$Section=$Island
$Key='ImageServer'
CALL 'ReadINI.KIX'
?
IF $Value='**Not Found**'
$DefImageServer=''
' Image Server: '
ELSE
$DefImageServer=$Value
$Space=20-LEN($DefImageServer)
WHILE $Space>0
' ' $Space=$Space-1
LOOP
'Image Server [$DefImageServer]: '
ENDIF
GETS $ImageServer
IF $ImageServer='' AND $DefImageServer<>''
$ImageServer=$DefImageServer
ENDIF
IF $ImageServer=''
$ErrorMessage='You must enter the name of the image server!'
GOTO 'Error'
ELSE
$Section=$ComputerName
$Key='IPAddress'
CALL 'ReadINI.KIX'
IF $Value='**Not Found**'
$ErrorMessage='Could not find IP Address for $ComputerName!'
GOTO 'Error'
ELSE
$IPAddress=$Value
CALL 'FixIP.KIX'
$ServerIP=$IPAddress
$Key='SubnetMask'
CALL 'ReadINI.KIX'
IF $Value='**Not Found**'
$ErrorMessage='Could not find Subnet Mask for $ComputerName!'
GOTO 'Error'
ELSE
$IPAddress=$Value
CALL 'FixIP.KIX'
$ServerSubnetMask=$IPAddress
$Key='DefaultGateway'
CALL 'ReadINI.KIX'
IF $Value='**Not Found**'
$ErrorMessage='Could not find Default Gateway for $ComputerName!'
GOTO 'Error'
ELSE
$IPAddress=$Value
CALL 'FixIP.KIX'
$ServerDefaultGateway=$IPAddress
$Section=$Island
$Key='NameServer'
CALL 'ReadINI.KIX'
IF $Value='**Not Found**'
$ErrorMessage='Could not find Name Server for $Island!'
GOTO 'Error'
ELSE
$IPAddress=$Value
CALL 'FixIP.KIX'
$NameServer=$IPAddress
$Key='NameServer'
CALL 'ReadINI.KIX'
IF $Value='**Not Found**'
$ErrorMessage='Could not find Backup Name Server for $Island!'
GOTO 'Error'
ELSE
$IPAddress=$Value
CALL 'FixIP.KIX'
$BackupNameServer=$IPAddress
$FoundComputerName=1
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ELSE
$ErrorMessage='You must enter a name for this server!'
GOTO 'Error'
ENDIF
GOTO 'OK'
:Error
COLOR r+/n
? $ErrorMessage ?
COLOR n/n
'Press any key to continue (X to abort)...' ?
GET $Key
IF $Key='x' GOTO 'Abort' ENDIF
$FoundComputerName=0
:OK
LOOP

? ?
' Server Name: ' COLOR w+/n '$ComputerName' COLOR n/n ?
' IP Address: ' COLOR w+/n '$ServerIP' COLOR n/n ?
' Subnet Mask: ' COLOR w+/n '$ServerSubnetMask' COLOR n/n ?
' Default Gateway: ' COLOR w+/n '$ServerDefaultGateway' COLOR n/n ? ?
' Primary WINS: ' COLOR w+/n '$NameServer' COLOR n/n ?
' Secondary WINS: ' COLOR w+/n '$BackupNameServer' COLOR n/n ? ?
' Image Server: ' COLOR w+/n '$ImageServer' COLOR n/n ? ?

COLOR g+/n
? 'Configuring Protocol.INI..'
COLOR n/n ?
' ' SHELL 'INI "$ProtocolINIFile" WRITE tcpip IPAddress0 "$ServerIP"'
' ' SHELL 'INI "$ProtocolINIFile" WRITE tcpip SubNetMask0 "$ServerSubnetMask"'
' ' SHELL 'INI "$ProtocolINIFile" WRITE tcpip DefaultGateway0 "$ServerDefaultGateway"'
' ' SHELL 'INI "$ProtocolINIFile" WRITE tcpip WINS_SERVER0 "$NameServer"'
' ' SHELL 'INI "$ProtocolINIFile" WRITE tcpip WINS_SERVER1 "$BackupNameServer"'

COLOR g+/n
? 'Configuring System.INI..'
COLOR n/n ?
' ' SHELL 'INI "$SystemINIFile" WRITE network ComputerName "$ComputerName"'

SHELL 'COMMAND.COM /C ECHO @@ECHO OFF > A:\Images.Bat'
SHELL 'COMMAND.COM /C ECHO NET USE Z: \\$ImageServer\Images /YES >> A:\Images.Bat'
SHELL 'COMMAND.COM /C ECHO Z:\PQDI\IMAGE $ComputerName >> A:\Images.Bat'

GOTO 'Finish'

:Abort

:Finish

Here is ReadINI.KIX:

code:
; $Filename - INI file to read from
; $Section - SectionName to read from
; $Key - Keyname to read from
; returns $Value

$Value='**Not Found**'

IF OPEN(1,'$Filename')=0
$KeyLen=LEN($Key)
$Line=READLINE(1)
$Found=0
WHILE @ERROR=0 AND $Found=0
$FirstChar=SUBSTR($Line,1,1)
IF $FirstChar<>';'
IF $FirstChar='['
IF SUBSTR($Line,2,INSTR($Line,']')-2)=$Section
$CorrectSection=1
ELSE
$CorrectSection=0
ENDIF
ELSE
IF $CorrectSection=1 AND (SUBSTR($Line,1,$KeyLen+1)=($Key+'='))
$Value=SUBSTR($Line,INSTR($Line,'=')+1,LEN($Line))
$Found=1
ENDIF
ENDIF
ENDIF
$Line=READLINE(1)
LOOP
IF CLOSE(1)<>0 'Error @ERROR closing file' ? ENDIF
ELSE
'Error @ERROR while trying to open $Filename' ?
ENDIF

And FixIP.KIX:

code:
 
; $IPAddress is IP Address to fix

WHILE INSTR($IPAddress,'.')
$Pos=INSTR($IPAddress,'.')
$IPAddress=SUBSTR($IPAddress,1,$Pos-1)+' '+SUBSTR($IPAddress,$Pos+1,LEN($IPAddress))
LOOP

Sigh, if only 2.33 supported UDFs [Wink]

Cheers,
Michael.