Batch file question RRS feed

  • Question

  • We are running PeopleSoft Finance on Windows 2008 Server. We have a need to automate the bouncing of a web server and clearing web server cache. We have come up with the following script, however we think the NET STOP command is asynchronous and the clear cache would start before the web service is stopped.

    We would like to be able to delay it so that the clear cache doesn't start until the web service is stopped, and also so that the NET START would not commence until cache is cleared. Can anyone help us with this? 

    @echo off

    echo Stopping Web Server ...
    echo ======================================================
    net stop W3SVC DEVTST-PIA
    echo Clearing Web Server Cache ...

    set CacheDir=S:\PT8.53\webserv\FNXX\applications\peoplesoft\PORTAL.war\FNXX\cache
    del /q /s /f %CacheDir%
    rd /s /q %CacheDir%

    echo Web Server Cache has been cleared ...
    echo Starting Web Server ...

    net start W3SVC DEVTST-PIA
    echo ======================================================
    echo Web Server Restarted

    Life is hard, but it's harder when you're stupid! John 'Duke' Wayne

    Thursday, March 26, 2015 8:53 PM