anchor.diff:  if NOT "x%DEBUG%" == "x" (
     set "DEBUG_MODE=%DEBUG%
   )
  -
   
   rem Get the program name before using shift as the command modify the variable ~nx0
   if "%OS%" == "Windows_NT" (
  
positive.code:         move /y "%JBOSS_LOG_DIR%\gc.log.3" "%JBOSS_LOG_DIR%\backupgc.log.3" > nul 2>&1
          move /y "%JBOSS_LOG_DIR%\gc.log.4" "%JBOSS_LOG_DIR%\backupgc.log.4" > nul 2>&1
          move /y "%JBOSS_LOG_DIR%\gc.log.*.current" "%JBOSS_LOG_DIR%\backupgc.log.current" > nul 2>&1
          "%JAVA%" -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -Xloggc:%XLOGGC% -XX:-TraceClassUnloading -version > nul 2>&1
          if not errorlevel == 1 (
            if not exist "%JBOSS_LOG_DIR" > nul 2>&1 (
              mkdir "%JBOSS_LOG_DIR%"
            )
           set XLOGGC="%JBOSS_LOG_DIR%\gc.log"
           set "JAVA_OPTS=-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -Xloggc:%XLOGGC% -XX:-TraceClassUnloading %JAVA_OPTS%"
          )
         )
      )
  )
  
  rem Find jboss-modules.jar, or we can't continue
  if exist "%JBOSS_HOME%\jboss-modules.jar" (
      set "RUNJAR=%JBOSS_HOME%\jboss-modules.jar"
  ) else (
    echo Could not locate "%JBOSS_HOME%\jboss-modules.jar".
    echo Please check that you are in the bin directory when running this script.
    goto END
  )
  
  rem Setup JBoss specific properties
  
  rem Setup directories, note directories with spaces do not work
  setlocal EnableDelayedExpansion
  set "CONSOLIDATED_OPTS=%JAVA_OPTS% %SERVER_OPTS%"
  set baseDirFound=false
  set configDirFound=false
  set logDirFound=false
  for %%a in (!CONSOLIDATED_OPTS!) do (
     if !baseDirFound! == true (
        set "JBOSS_BASE_DIR=%%~a"
        set baseDirFound=false
     )
     if !configDirFound! == true (
        set "JBOSS_CONFIG_DIR=%%~a"
        set configDirFound=false
     )
     if !logDirFound! == true (
        set "JBOSS_LOG_DIR=%%~a"
        set logDirFound=false
     )
     if "%%~a" == "-Djboss.server.base.dir" (
         set baseDirFound=true
     )
     if "%%~a" == "-Djboss.server.config.dir" (
         set configDirFound=true
     )
     if "%%~a" == "-Djboss.server.log.dir" (
         set logDirFound=true
     )
  )
  
  rem If the -Djava.security.manager is found, enable the -secmgr and include a bogus security manager for JBoss Modules to replace
  echo(!JAVA_OPTS! | findstr /r /c:"-Djava.security.manager" > nul && (
      echo ERROR: The use of -Djava.security.manager has been removed. Please use the -secmgr command line argument or SECMGR=true environment variable.
      GOTO :EOF
  )
  setlocal DisableDelayedExpansion
  
  rem Set default module root paths
  if "x%JBOSS_MODULEPATH%" == "x" (
    set  "JBOSS_MODULEPATH=%JBOSS_HOME%\modules"
  )
  
  rem Set the standalone base dir
  if "x%JBOSS_BASE_DIR%" == "x" (
    set  "JBOSS_BASE_DIR=%JBOSS_HOME%\standalone"
  )
  rem Set the standalone log dir
  if "x%JBOSS_LOG_DIR%" == "x" (
    set  "JBOSS_LOG_DIR=%JBOSS_BASE_DIR%\log"
  )
  rem Set the standalone configuration dir
  if "x%JBOSS_CONFIG_DIR%" == "x" (
    set  "JBOSS_CONFIG_DIR=%JBOSS_BASE_DIR%\configuration"
  )
  
  rem Set the module options
  set "MODULE_OPTS="
  
negative.code: 
  rem By default debug mode is disable.
  set DEBUG_MODE=false
  set DEBUG_PORT_VAR=8787
  rem Set to all parameters by default
  set "SERVER_OPTS=%*"
  
  