本帖最后由 aloha20200628 于 2024-6-19 11:10 编辑
给一个批处理+js混编版本》
可将当前目录下(包括子目录)常见格式(*.mp4/mkv/avi/wmv)的视频文件简要信息汇总,输出文件是当前目录下的一个文本文件="影片简报"。将本脚本存盘到视频目录下运行,扩展名为.cmd。- @set @x=1 /* &@echo off
- dir/s/b/a-d *.mp4 *.wmv *.mkv *.avi>mF.lst
- echo,... 在当前目录下生成 "影片简报" ...
- (for /f "delims=" %%F in (mF.lst) do (
- for /f "delims=" %%v in ('cscript /nologo /e:jscript "%~f0" "%%~dpF" "%%~nxF" ') do (
- for /f "tokens=1-2 delims=," %%1 in ("%%~v") do (
- echo,【影片名称】:%%~nF
- echo,【影片格式】:%%~xF
- echo,【影片大小】:%%1
- echo,【影片时长】:%%2 )
- )
- ))>"影片简报"
- (del/q mF.lst)&pause&exit/b */
- var argv = WScript.arguments;
- var objShell = new ActiveXObject("shell.application");
- var objFolder = objShell.NameSpace(argv.item(0));
- var objFolderItem = objFolder.ParseName(argv.item(1));
- var sizeF = objFolder.GetDetailsOf(objFolderItem, 1);
- var durationF = objFolder.GetDetailsOf(objFolderItem, 27);
- WScript.echo(sizeF+','+durationF);
复制代码
|