Heres a tricky problem with Enteo, When executing a batch file enteo only gives a batch file 10 minutes to complete before moving on.
Generally speaking this is no problem as how many batch files do you run take over 10 minutes?
This problem came to light for us when enteo began causing our ESX servers to purple screen of death during the pe stage of the build, which resulted in us moving our virtual servers to a stable ESX while we rebuilt. The problem was that the ESX was so slow with all the added servers that our scripted citrix updates were taking over 10 minutes, the script continued, rebooted the server during the updates and low and behold a very sick citrix server.
The trick to get around this, and i recommend this for any batch file you run in enteo, is to create a looping if statement in the enteo script to check for a registry key. Once you have this key created run your updates then delete the key as the last line in your batch file. This will cause enteo to loop even after the 10 minutes leaving your critical updates to install without fear of being.
heres the idea for the enteo script:
execute %systemdrive%longbatchfile.bat /?
if exist regkey goto sleep
And in the batchfile create the reg key, do your work then delete it:
reg add hklmsoftwareenteo /v checkkey
reg delete hklmsoftwareenteo /v checkkey
what will happen is simple, even if the script times out, the script will carry on sleeping until the key is deleted, no matter how long it takes.
After the jump is an example of my code so you can see what we did to get around this
Execute(‘%WINSYSDIR%shutdown.exe /r /t 30′)
Rem Adding check registry key
Reg add “HKEY_LOCAL_MACHINESOFTWAREEnteo” /v rebootstatus /t REG_SZ /d “0” /f
msiexec /p %windir%temphotfixPSE450W2K3R02.msp /qn /norestart
msiexec /p %windir%temphotfixPSE450R02W2K3002.msp /qn /norestart
msiexec /p %windir%temphotfixPSE450R02W2K3004.msp /qn /norestart
msiexec /p %windir%temphotfixPSE450R02W2K3007.msp /qn /norestart
msiexec /p %windir%temphotfixPSE450R02W2K3008.msp /qn /norestart
msiexec /p %windir%temphotfixPSE450R02W2K3010.msp /qn /norestart
msiexec /p %windir%temphotfixPSE450R02W2K3014.msp /qn /norestart
msiexec /p %windir%temphotfixPSE450R02W2K3036.msp /qn /norestart
msiexec /p %windir%temphotfixPSE450R02W2K3037.msp /qn /norestart
Rem Clearing check registry key
reg delete HKEY_LOCAL_MACHINESOFTWAREEnteo /v rebootstatus /f
as with the above, the batch file controlling when the reg key is created and deleted determines when the script is allowed to end, regardless of enteo’s 10 minute rule.