Windows starts the software by searching the software startup path through the service name

Windows starts the software by searching the software startup path through the service name

Note: QQ Butler and 360 Security are used under normal circumstancestaskkill cannot be stopped because there is a "self-protection" in the security settings, which is checked by default under normal circumstances. In this way, you cannot use taskkill to close. After unchecking, you can use taskkill to close

@echo off
rem "关闭服务"
taskkill /f /t /im QQPCTray.exe

setlocal enabledelayedexpansion
rem 指定待搜索的文件
set "FileName=QQPCTray.exe"
rem echo 正在搜索,请稍候...
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
  if exist %%a:\ (
    pushd %%a:\
    for /r %%b in (*%FileName%) do (
      if /i "%%~nxb" equ "%FileName%" (
        rem echo,%%b
		set filePth=%%b
		echo !filePth!
		
		rem "倒计时"
		timeout /nobreak /t 3
		
		rem "截取倒数13位之前的内容"
		set QQPath=!filePth:~,-13!
		echo !QQPath!
		
		rem "启动软件"
		start /d "!QQPath!" QQPCTray.exe
      )
    )
    popd
  )
)

Guess you like

Origin blog.csdn.net/D1179869625/article/details/132478887