thgis script is suppose to kill all java processes using their pids. please find below as I found it
#
# Any errors or messages are sent to a ddmmyy.log logfile, where
# yymmdd represents the date on which the log is created.
Configuration: You should not change any of the environment variables. If the NT HOME
# variable is set other than the directory where these scripts are, then
# you should change the SCRIPTDIR variable to reflect the full path.
# e.g. SCRIPTDIR=//d/Was_Admin/Overnight
#
# Due to a limitation in the cygwin's kill command, it cannot be used here.
# The current implementation uses the NT Resource Kit's Kill.exe command.
# Unlike Unix kill, NT's kill takes one pid at a time. Thus this script
# loops round in a for loop attempting to kill each pid in turn. When
# you migrate over to Unix, you should uncomment the line:
#
# "#$SCRIPTDIR/kill.exe -9 $PIDS >> $LOGFILE 2>&1"
#
# and remove the for loop.
#
export TODAY_DATE=`date +%y%m%d`
export KILLDIR=//c/WINNT/system32
export SCRIPTDIR=//d/Was_Admin/Overnight
export LOGFILE=${SCRIPTDIR}/logs/${TODAY_DATE}.log
#date >> $LOGFILE
echo `date +%D:%T` " - Checking for stale applications ....." >> $LOGFILE
export PIDS="`ps -W | grep java | awk '{ print $1 }'`"
if [ "$PIDS" != "" ]
then
#echo "" >> $LOGFILE
echo `date +%D:%T` " - Attempting to kill stale applications with pids \"$PIDS\" ....." >> $LOGFILE
# ${SCRIPTDIR}/kill.exe -9 $PIDS >> $LOGFILE 2>&1
for pid in $PIDS
do
${KILLDIR}/Kill.exe $pid >> $LOGFILE 2>&1
done
fi
#echo "" >> $LOGFILE
#date >> $LOGFILE
echo `date +%D:%T` " - Cleared all applications." >> $LOGFILE
echo "" >> $LOGFILE
#
# Any errors or messages are sent to a ddmmyy.log logfile, where
# yymmdd represents the date on which the log is created.
Configuration: You should not change any of the environment variables. If the NT HOME
# variable is set other than the directory where these scripts are, then
# you should change the SCRIPTDIR variable to reflect the full path.
# e.g. SCRIPTDIR=//d/Was_Admin/Overnight
#
# Due to a limitation in the cygwin's kill command, it cannot be used here.
# The current implementation uses the NT Resource Kit's Kill.exe command.
# Unlike Unix kill, NT's kill takes one pid at a time. Thus this script
# loops round in a for loop attempting to kill each pid in turn. When
# you migrate over to Unix, you should uncomment the line:
#
# "#$SCRIPTDIR/kill.exe -9 $PIDS >> $LOGFILE 2>&1"
#
# and remove the for loop.
#
export TODAY_DATE=`date +%y%m%d`
export KILLDIR=//c/WINNT/system32
export SCRIPTDIR=//d/Was_Admin/Overnight
export LOGFILE=${SCRIPTDIR}/logs/${TODAY_DATE}.log
#date >> $LOGFILE
echo `date +%D:%T` " - Checking for stale applications ....." >> $LOGFILE
export PIDS="`ps -W | grep java | awk '{ print $1 }'`"
if [ "$PIDS" != "" ]
then
#echo "" >> $LOGFILE
echo `date +%D:%T` " - Attempting to kill stale applications with pids \"$PIDS\" ....." >> $LOGFILE
# ${SCRIPTDIR}/kill.exe -9 $PIDS >> $LOGFILE 2>&1
for pid in $PIDS
do
${KILLDIR}/Kill.exe $pid >> $LOGFILE 2>&1
done
fi
#echo "" >> $LOGFILE
#date >> $LOGFILE
echo `date +%D:%T` " - Cleared all applications." >> $LOGFILE
echo "" >> $LOGFILE