﻿@echo off & setlocal enabledelayedexpansion
  ::ipconfig>ip.txt
  
   
netstat -aon |findstr 8103>pid.txt
      
     for /f "delims=" %%a in (pid.txt) do (
         
      for /f "tokens=1* delims=:" %%i in ('call echo %%a^|find /i "TCP"') do (
         echo %%a
     ::��ȡ�����ݹ��˺�,д����һ�����±���
     rem Echo %%a>>"text.txt"
        ) 
    )
rem ��ȡ�ļ�������
set /P OEM=<pid.txt
  
rem ��ȡ�ļ��е��ַ���
  
echo  %OEM:~71,76%
  
taskkill /f /pid %OEM:~71,76%

@echo off
       cd C:\server\cwg_crm\to-globex-service
       if not exist C:\server\cwg_crm\crm-to-globex\backup\to-globex md C:\server\cwg_crm\backup\to-globex
       if exist "C:\server\cwg_crm\to-globex-service\crm-globex-1.0.0.jar" (
	copy "C:\server\cwg_crm\to-globex-service\crm-globex-1.0.0.jar" "C:\server\cwg_crm\backup\to-globex\com-crm-to-globex-1.0.0-%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.jar"
	del "C:\server\cwg_crm\to-globex-service\crm-globex-1.0.0.jar"
) 
       if exist "C:\server\cwg_crm\to-globex-service\dependency\crm-backend-1.0.0.jar" (
	copy "C:\server\cwg_crm\to-globex-service\dependency\crm-backend-1.0.0.jar" "C:\server\cwg_crm\backup\to-globex\crm-backend-1.0.0-%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.jar"
	del "C:\server\cwg_crm\to-globex-service\dependency\crm-backend-1.0.0.jar"
)
       if exist "C:\server\cwg_crm\to-globex-service\dependency\crm-login-backend-1.0.0.jar" (
	copy "C:\server\cwg_crm\to-globex-service\dependency\crm-login-backend-1.0.0.jar" "C:\server\cwg_crm\backup\to-globex\crm-login-backend-1.0.0-%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.jar"
	del "C:\server\cwg_crm\to-globex-service\dependency\crm-login-backend-1.0.0.jar"
)
       if exist "C:\server\cwg_crm\to-globex-service\dependency\crm-core-1.0.0.jar" (
	copy "C:\server\cwg_crm\to-globex-service\dependency\crm-core-1.0.0.jar" "C:\server\cwg_crm\backup\to-globex\crm-core-1.0.0-%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.jar"
	del "C:\server\cwg_crm\to-globex-service\dependency\crm-core-1.0.0.jar"
)
       cd "C:\Users\Administrator\crm\crm-to-globex"

       copy "C:\Users\Administrator\crm\crm-to-globex\crm-globex-1.0.0.jar" "C:\server\cwg_crm\to-globex-service\crm-globex-1.0.0.jar"
       copy "C:\Users\Administrator\crm\crm-to-globex\dependency\crm-backend-1.0.0.jar" "C:\server\cwg_crm\to-globex-service\dependency\crm-backend-1.0.0.jar"
       copy "C:\Users\Administrator\crm\crm-to-globex\dependency\crm-login-backend-1.0.0.jar" "C:\server\cwg_crm\to-globex-service\dependency\crm-login-backend-1.0.0.jar"
       copy "C:\Users\Administrator\crm\crm-to-globex\dependency\crm-core-1.0.0.jar" "C:\server\cwg_crm\to-globex-service\dependency\crm-core-1.0.0.jar"
       cd "C:\server\cwg_crm\to-globex-service"
       title crm-to-globex
       javaw -Xmx1024m  -Xmx512m -Dloader.path=dependency  -jar crm-globex-1.0.0.jar --spring.profiles.active=test
       echo good bye