﻿@echo off & setlocal enabledelayedexpansion
  ::ipconfig>ip.txt
  
   
netstat -aon |findstr :8004>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 D:\server\crm\pay-service
       if not exist "D:\server\crm\backup\pay\%date:~10,4%%date:~4,2%%date:~7,2%" md "D:\server\crm\backup\pay\%date:~10,4%%date:~4,2%%date:~7,2%"
       if exist "D:\server\crm\pay-service\com-crm-pay-1.0.0.jar" (
	copy "D:\server\crm\pay-service\com-crm-pay-1.0.0.jar" "D:\server\crm\backup\pay\%date:~10,4%%date:~4,2%%date:~7,2%\com-crm-pay-1.0.0-%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%%time:~6,2%.jar"
	del "D:\server\crm\pay-service\com-crm-pay-1.0.0.jar"
) 
       if exist "D:\server\crm\pay-service\dependency\crm-backend-1.0.0.jar" (
	copy "D:\server\crm\pay-service\dependency\crm-backend-1.0.0.jar" "D:\server\crm\backup\pay\%date:~10,4%%date:~4,2%%date:~7,2%\crm-backend-1.0.0-%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%%time:~6,2%.jar"
	del "D:\server\crm\pay-service\dependency\crm-backend-1.0.0.jar"
)
       if exist "D:\server\crm\pay-service\dependency\crm-login-backend-1.0.0.jar" (
	copy "D:\server\crm\pay-service\dependency\crm-login-backend-1.0.0.jar" "D:\server\crm\backup\pay\%date:~10,4%%date:~4,2%%date:~7,2%\crm-login-backend-1.0.0-%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%%time:~6,2%.jar"
	del "D:\server\crm\pay-service\dependency\crm-login-backend-1.0.0.jar"
)
       if exist "D:\server\crm\pay-service\dependency\crm-core-1.0.0.jar" (
	copy "D:\server\crm\pay-service\dependency\crm-core-1.0.0.jar" "D:\server\crm\backup\pay\%date:~10,4%%date:~4,2%%date:~7,2%\crm-core-1.0.0-%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%%time:~6,2%.jar"
	del "D:\server\crm\pay-service\dependency\crm-core-1.0.0.jar"
)
       cd "C:\Users\Administrator\crm\crm-pay"
       c:
       copy "C:\Users\Administrator\crm\crm-pay\com-crm-pay-1.0.0.jar" "D:\server\crm\pay-service\com-crm-pay-1.0.0.jar"
       copy "C:\Users\Administrator\crm\crm-pay\dependency\crm-backend-1.0.0.jar" "D:\server\crm\pay-service\dependency\crm-backend-1.0.0.jar"
       copy "C:\Users\Administrator\crm\crm-pay\dependency\crm-login-backend-1.0.0.jar" "D:\server\crm\pay-service\dependency\crm-login-backend-1.0.0.jar"
       copy "C:\Users\Administrator\crm\crm-pay\dependency\crm-core-1.0.0.jar" "D:\server\crm\pay-service\dependency\crm-core-1.0.0.jar"
       cd D:\server\crm\pay-service
       D:
       title crm-pay
        javaw  -Xmx1536m -Dloader.path=dependency -jar com-crm-pay-1.0.0.jar --spring.profiles.active=prod
       echo good bye