anchor.diff:  :print_usage
   	echo Usage: mmx-server.bat [-p] {start^|stop^|restart}
   	echo.
  -	echo Start, stop, or restart the Magnet Message server.
  +	echo Start, stop, or restart the %PROGNAME%.
   	echo. 
   	echo Options:
   	echo    -p    No port check when starting.
  
positive.code: 
  :start
  	if %check_port%==true (
  		call :check_ports
  	)
  	call :check_java
  
  	if exist %PROG%.pid (
  		echo.
  		echo Error! Magnet Message server is already running or you have a stale pid file. If Magnet Message server is not running, then please delete mmx-standalone-dist-win\messaging\bin\mmx-server.pid file and try again.
  		exit 1
  	)	
  	call :check_java_home
  	start %TITLE% "%JAVA_HOME%\bin\java" -DopenfireHome="%OPENFIRE_HOME%" -jar ..\lib\startup.jar
  	if 0 neq %ERRORLEVEL% (
  		echo Error starting with error code:%ERRORLEVEL%
  		exit 1
  	)
  	timeout /t 3 >nul
  	FOR /F "usebackq tokens=2" %%i IN (`tasklist /nh /fi "WINDOWTITLE eq %TITLE%"`) DO echo %%i > .\%PROG%.pid
  goto :end
  
  
  
  :check_ports
  	netstat -aon | findstr "%PORT_TO_CHECK%" 1>NUL
  	if %ERRORLEVEL% equ 0 (
  		echo.
  		echo Error! TCP port "%PORT_TO_CHECK%" is already in use; thus, cannot start Magnet Message. Please refer to readme.htm on how to change the ports.
  		exit 1
  	)
  	echo Using ports "%PORT_TO_CHECK%"
  goto :eof
  
  
  
negative.code: 		taskkill /f /pid !pid! /t >nul
  		del .\%PROG%.pid
  	) else (
  		echo %PROGNAME% is not running
  	)
  	endlocal
  goto :end
  