微信比较简单,直接 用批处理运行两次即可
企业 微信不行,找到以下方法,其实就是修改一下那个注册表
@echo off if not exist "C:Program Files (x86)WXWorkWXWork.exe " goto exit c: cd C:Program Files (x86)WXWork start WXWork.exe reg add HKEY_CURRENT_USERSoftwareTencentWXWork /v multi_instances /t REG_DWORD /d 5 /f ping -n 1 127.0.0.1>nul 2>nul reg add HKEY_CURRENT_USERSoftwareTencentWXWork /v multi_instances /t REG_DWORD /d 5 /f start WXWork.exe goto eof :exit echo 企业微信文件不存在. pause :eof
加一个vbs写的
Dim name Set name=WScript.CreateObject("WScript.Shell") Dim ComputerName,RegPath RegPath="HKEY_CURRENT_USERSoftwareTencentWXWorkExecutable" 'On Error Resume Next ComputerName=name.RegRead(RegPath) if Err.Number<>0 then msgbox "未安装企业微信" WScript.quit end if name.Regwrite"HKCUSoftwareTencentWXWorkmulti_instances",8,"REG_DWORD" name.Run chr(34) & ComputerName & chr(34),1,0