printf_process_memory.bat
@echo off
set "fmt=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%"
set "file=tsk-%fmt%.log"
# 中文乱码处理
chcp 65001
echo 映像名字 PID 会话名 会话# 内存使用 状态 用户名 CPU时间 窗口标题 >> "%file%"
echo ============ ======== ========== =========== ============ ============ ================== ================== ============== >> "%file%"
# /nb 不显示标题 /v 打印完整信息
tasklist /nh /v |sort>> "%file%"
#pause