@echo off
rem ##################################################
rem # Name: Close_Stop.bat
rem # Location: uniform_server
rem # Created By: The Uniform Server Development Team
rem # Edited Last By: MPG (ric)
rem # V 1.0 21-11-2008
rem ##################################################

@echo off
:Define current working directory
pushd %~dp0

set Disk=%1
IF "%Disk%"=="" set Disk=l

del ..\..\..\usr\local\apache2\logs\httpd.pid

%Disk%:\home\admin\program\pskill.exe mysqld-opt.exe
IF ERRORLEVEL 1 goto nomysql

:MySQL server is running get password 
SET /P pass=<..\www\mysql_password

:Access server using password and shutdown server 

%Disk%:\usr\local\mysql\bin\mysqladmin.exe --character-sets-dir="/usr/local/mysql/share/charsets/" --user=root --password=%pass% shutdown

:nomysql

:Kill off virtual drive
subst %Disk%: /D
:pause
:Restore original location
popd

