Enteo: The 10 minute rule on batch files.

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 /?
:check
if exist regkey goto sleep
del %systemdrive%longbatchfile
Exitproc
:sleep
sleep 60
goto check

And in the batchfile create the reg key, do your work then delete it:

reg add hklmsoftwareenteo /v checkkey
update1
update2
update3
update4
update5
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 :)

Enteo EScript:

Copy(‘.Extern$*.*’,’%windir%TempHotfix’)/TW
Execute(‘%windir%temphotfixhotfix_install.bat’)/?
: Check
If RegValueExists(‘HKEY_LOCAL_MACHINESOFTWAREEnteo’,’rebootstatus’)
goto Sleep
Delete(‘%windir%temphotfix*.*’)
RemoveDir(‘%windir%temphotfix’)/S/TW
Execute(‘%WINSYSDIR%shutdown.exe /r /t 30′)
ExitProc(Done)
: Sleep
Sleep(’60’)
goto Check

Batch file:

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.

Related Posts

Cataloging Exported packages from Frontrange Enteo... This is just a quick powershell script I threw together to catalog exported packages. By default when you export packages from Frontrange DSM (form...
Enabling RDP on a server remotely. There's very little more annoying in a windows environment than having to go to a console of a server because some idiot has disabled remote administr...
Remove shell extensions after installing Adobe Acr... A pet peeve of mine are context menu extensions... Why software vendors decide to include non optional context menu addons are besides me! A good exam...

4 Comments About “Enteo: The 10 minute rule on batch files.

    1. Andrew Morgan

      Hi Stefan,

      thank you kindly for your update, that option looks useful.

      That being said, I think I would prefer to loop the job over and over until it has finished rather than entering a higher timeout time and hoping it finishes in the new timeframe.

      Thank you kindly for contributing!

      Andrew

      Reply

Leave a Reply