Hunter的大杂烩 技术学习笔记

2024-07-15

常用DOS批处理

Filed under: 技术话题 — hunter @ 11:28 pm

setlocal enabledelaydexpansion

delayedexpansion 说明见:https://blog.csdn.net/rhcgrys/article/details/124283862

  1. 批量for循环转码文件(或修改文件后缀)

for /f “delims=” %%a in (‘dir /b^|findstr /l “.avi .mp4 .mkv”‘) do (
if not exist “%%~na.mpeg” (
ffmpeg -i “%%~a” -c:v mpeg2_qsv -qscale 8 -c:a mp3 -vf subtitles=”filename=%%~na.srt:charenc=GBK” “%%~na.mpeg”
)
)

注:修改for命令,可同时处理多种视频文件转码mpeg

2. 获取所有系统服务详细信息,比如提取系统服务执行文件路径

@for /f “tokens=1,2 delims= ” %i in (‘sc query state^=all ^|findstr SERVICE_NAME’) do ( @sc qc %j | findstr BINARY_PATH_NAME >> svr.lst)

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress