本文目录导读:

这里为您提供几个不同场景下自动清理 Webex 缓存的脚本(Windows 环境为主,含 macOS 说明),请根据您的需求选择。
Windows 批处理脚本 (.bat)
这个脚本会:
- 关闭 Webex(避免文件占用)
- 删除常见的缓存文件夹
- 重建空文件夹(防止部分权限问题)
@echo off
echo 正在停止 Webex 进程...
taskkill /f /im Webex.exe 2>nul
taskkill /f /im CiscoCollabHost.exe 2>nul
timeout /t 3 /nobreak >nul
echo 正在清除 Webex 缓存...
:: Webex Teams/Meetings 缓存路径
set CACHE_DIRS=(
"%LOCALAPPDATA%\Cisco\Unified Communications\"
"%APPDATA%\Cisco\Unified Communications\"
"%LOCALAPPDATA%\Cisco\Webex\MeetingIndicator"
"%APPDATA%\Cisco\Webex\MeetingIndicator"
"%LOCALAPPDATA%\Cisco\Cisco Webex Meetings"
"%APPDATA%\Cisco\Cisco Webex Meetings"
"%USERPROFILE%\AppData\Local\Cisco\Cisco Webex Meetings"
"%TEMP%\Cisco\Webex\"
)
for %%d in %CACHE_DIRS% do (
if exist "%%~d" (
echo 清理: %%~d
rmdir /s /q "%%~d" 2>nul
mkdir "%%~d" 2>nul
)
)
echo 缓存清理完成!
pause
PowerShell 脚本 (.ps1)
更精细、可定制性更强:
# 停止 Webex 相关进程
Write-Host "正在停止 Webex 进程..." -ForegroundColor Yellow
Get-Process | Where-Object { $_.ProcessName -match "Webex|CiscoCollab" } | ForEach-Object {
try {
$_.Kill()
Write-Host "已杀死进程: $($_.ProcessName)" -ForegroundColor Gray
} catch {
Write-Host "无法杀死进程: $($_.ProcessName) - $_" -ForegroundColor Red
}
}
# 等待进程完全退出
Start-Sleep -Seconds 3
# 定义缓存路径
$cachePaths = @(
"$env:LOCALAPPDATA\Cisco\Unified Communications",
"$env:APPDATA\Cisco\Unified Communications",
"$env:LOCALAPPDATA\Cisco\Webex\MeetingIndicator",
"$env:APPDATA\Cisco\Webex\MeetingIndicator",
"$env:LOCALAPPDATA\Cisco\Cisco Webex Meetings",
"$env:APPDATA\Cisco\Cisco Webex Meetings",
"$env:TEMP\Cisco\Webex"
)
$totalDeleted = 0
foreach ($path in $cachePaths) {
if (Test-Path $path) {
$size = (Get-ChildItem $path -Recurse -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum
try {
Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path $path -Force | Out-Null
$sizeMB = [math]::Round($size / 1MB, 2)
Write-Host "已清理: $path (释放 $sizeMB MB)" -ForegroundColor Green
$totalDeleted += $size
} catch {
Write-Host "清理失败: $path - $_" -ForegroundColor Red
}
} else {
Write-Host "路径不存在: $path" -ForegroundColor DarkGray
}
}
$totalMB = [math]::Round($totalDeleted / 1MB, 2)
Write-Host "`n清理完成!共释放空间: $totalMB MB" -ForegroundColor Cyan
# 可选:重启 Webex
# Start-Process "$env:LOCALAPPDATA\Programs\Webex\Webex.exe"
定时自动清理方案
方案A:Windows 任务计划程序 + 批处理
- 将上面的
.bat脚本保存为C:\Scripts\CleanWebexCache.bat - 打开 任务计划程序
- 创建基本任务:
- 触发器:每天/每周/登录时
- 操作:启动程序 →
C:\Scripts\CleanWebexCache.bat - 勾选「使用最高权限运行」
方案B:PowerShell 定时任务(无需任务计划程序)
# 创建定时任务,每天 3:00 AM 执行 $action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-NoProfile -WindowStyle Hidden -File `"C:\Scripts\CleanWebexCache.ps1`"" $trigger = New-ScheduledTaskTrigger -Daily -At 03:00AM $principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest Register-ScheduledTask -TaskName "CleanWebexCache" -Action $action -Trigger $trigger -Principal $principal
macOS 版本(zsh 脚本)
#!/bin/zsh
echo "正在关闭 Webex 进程..."
pkill -f 'Webex' 2>/dev/null
sleep 2
echo "正在清理缓存..."
CACHE_DIRS=(
"$HOME/Library/Application Support/Cisco/Unified Communications"
"$HOME/Library/Caches/Cisco/Webex"
"$HOME/Library/Caches/com.cisco.webex"
"$HOME/Library/Preferences/com.cisco.webex.plist"
)
for dir in "${CACHE_DIRS[@]}"; do
if [ -d "$dir" ]; then
size=$(du -sh "$dir" 2>/dev/null | cut -f1)
rm -rf "$dir"
mkdir -p "$dir"
echo "已清理: $dir (释放 $size)"
fi
done
echo "缓存清理完成!"
使用提示
- 权限问题:建议以管理员身份运行脚本(Windows 右键 → 以管理员身份运行)
- 影响范围:Webex 缓存包括:
- 会议历史记录
- 下载的会议文件
- 联系人头像缓存
- 插件更新缓存
- 登录凭据(部分)
- 副作用:清理后首次启动 Webex 可能会稍慢(需重建缓存),但长期运行会更流畅
- 自定义路径:Webex 安装在非默认路径,请修改脚本中的路径变量
您可以根据需要选择其中一个,或组合使用,如果需要帮助调整特定版本的 Webex(如 Webex Teams vs Webex Meetings),请告知具体版本号。