2.1 KiB
设置向日葵自动关闭脚本:
@echo off
:: 设置字符集为UTF-8,彻底消灭控制台乱码
chcp 65001 >nul
set "psfile=%TEMP%\MonitorTemp.ps1"
:: 自动生成纯英文内核的监控代码,避开所有中文编码冲突和空格报错
echo $c = ' > "%psfile%"
echo using System; >> "%psfile%"
echo using System.Runtime.InteropServices; >> "%psfile%"
echo public class IT { >> "%psfile%"
echo [DllImport("user32.dll")] static extern bool GetLastInputInfo(ref LII plii); >> "%psfile%"
echo [StructLayout(LayoutKind.Sequential)] struct LII { public uint cbSize; public uint dwTime; } >> "%psfile%"
echo public static uint Get() { >> "%psfile%"
echo LII l = new LII(); l.cbSize = (uint)Marshal.SizeOf(l); GetLastInputInfo(ref l); return ((uint)Environment.TickCount - l.dwTime); >> "%psfile%"
echo } } >> "%psfile%"
echo ' >> "%psfile%"
echo Add-Type -TypeDefinition $c >> "%psfile%"
echo Write-Host "Monitoring started. Will close AweSun after 3 mins of inactivity." -ForegroundColor Cyan >> "%psfile%"
echo while($true) { >> "%psfile%"
echo Start-Sleep -Seconds 5 >> "%psfile%"
echo if([IT]::Get()/1000 -ge 180) { >> "%psfile%"
echo Stop-Process -Name "AweSun" -Force -ErrorAction SilentlyContinue >> "%psfile%"
echo Write-Host "Inactivity reached 3 mins. AweSun killed." -ForegroundColor Red >> "%psfile%"
echo } >> "%psfile%"
echo } >> "%psfile%"
color 0a
echo ===========================================
echo 阳光伴伴 (AweSun) 闲置监控已启动
echo [当前设定]:连续 3 分钟无操作自动强杀
echo (请保持此黑框运行,可将其最小化)
echo ===========================================
echo.
:: 执行自动生成的纯净脚本
powershell -NoProfile -ExecutionPolicy Bypass -File "%psfile%"
充磁电源评审会议纪要
目前需要做的事情整理
高速永磁转子简统化,工作梳理 明天开中车团的一届七次全委会 充磁电源会议纪要 碳纤维缠绕试件制作 碳纤维缠绕设备采购技术要求 内训师大赛PPT 演讲比赛 三维工艺布局 三坐标搬迁问题扯皮 培训报销