Actually they are scripted the first time around, just not after the rehosting process. (For some reason the rehost process terminates the script I launch it from when finished.)
I'm just using plain old batch file syntax. Quite a bit simpler.
REM ====== Stop Windchill Services =======
REM ======================================
net stop "PTC Windchill Method Server"
net stop "PTCWindchillWebServer"
net stop "PTC Windchill Directory Server"
REM ========= Clear Tomcat Cache =========
REM ======================================
RMDIR E:\ptc\Windchill_10.2\Windchill\tomcat\instances /Q /S
RMDIR E:\ptc\Windchill_10.2\Windchill\tasks\codebase\com\infoengine\compiledTasks /Q /S
REM ===== Delete Windchill Log Files =====
REM ======================================
RMDIR /S /Q E:\PTC\Windchill_10.2\Windchill\logs\
MKDIR E:\PTC\Windchill_10.2\Windchill\logs\
REM ====== Delete Apache Log Files =======
REM ======================================
del /f /q E:\PTC\Windchill_10.2\HTTPServer\logs\*
REM ====== Delete Directory Server Log Files ======
REM ======================================
del /f /q E:\PTC\Windchill_10.2\WindchillDS\server\logs\*