﻿@echo off & setlocal enabledelayedexpansion
  ::ipconfig>ip.txt
  
   
netstat -aon |findstr 9100>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\ib-task-service
       if not exist C:\server\cwg_crm\backup\ib-task md C:\server\cwg_crm\backup\ib-task
       if exist "C:\server\cwg_crm\ib-task-service\crm-ib-task-0.0.1-SNAPSHOT.jar" (
	copy "C:\server\cwg_crm\ib-task-service\crm-ib-task-0.0.1-SNAPSHOT.jar" "C:\server\cwg_crm\backup\ib-task\crm-ib-task-0.0.1-SNAPSHOT-%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.jar"
	del "C:\server\cwg_crm\ib-task-service\crm-ib-task-0.0.1-SNAPSHOT.jar"
) 
       if exist "C:\server\cwg_crm\ib-task-service\dependency\crm-backend-1.0.0.jar" (
	copy "C:\server\cwg_crm\ib-task-service\dependency\crm-backend-1.0.0.jar" "C:\server\cwg_crm\backup\ib-task\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\ib-task-service\dependency\crm-backend-1.0.0.jar"
)
       if exist "C:\server\cwg_crm\ib-task-service\dependency\crm-login-backend-1.0.0.jar" (
	copy "C:\server\cwg_crm\ib-task-service\dependency\crm-login-backend-1.0.0.jar" "C:\server\cwg_crm\backup\ib-task\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\ib-task-service\dependency\crm-login-backend-1.0.0.jar"
)
       if exist "C:\server\cwg_crm\ib-task-service\dependency\crm-core-1.0.0.jar" (
	copy "C:\server\cwg_crm\ib-task-service\dependency\crm-core-1.0.0.jar" "C:\server\cwg_crm\backup\ib-task\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\ib-task-service\dependency\crm-core-1.0.0.jar"
)
       cd "C:\Users\Administrator\crm\crm-ib-task"
       c:
       copy "C:\Users\Administrator\crm\crm-ib-task\crm-ib-task-0.0.1-SNAPSHOT.jar" "C:\server\cwg_crm\ib-task-service\crm-ib-task-0.0.1-SNAPSHOT.jar"
       copy "C:\Users\Administrator\crm\crm-ib-task\dependency\crm-backend-1.0.0.jar" "C:\server\cwg_crm\ib-task-service\dependency\crm-backend-1.0.0.jar"
       copy "C:\Users\Administrator\crm\crm-ib-task\dependency\crm-login-backend-1.0.0.jar" "C:\server\cwg_crm\ib-task-service\dependency\crm-login-backend-1.0.0.jar"
       copy "C:\Users\Administrator\crm\crm-ib-task\dependency\crm-core-1.0.0.jar" "C:\server\cwg_crm\ib-task-service\dependency\crm-core-1.0.0.jar"

       cd C:\server\cwg_crm\ib-task-service
       title crm-ib-task
       javaw -Xmx1024m -Dloader.path=dependency -jar crm-ib-task-0.0.1-SNAPSHOT.jar --spring.profiles.active=test
       echo good bye