功能:实现在刮削器没有数据时自动使用文件名生成nfo信息,并新建一个同名文件夹,然后将视频文件移动到该文件夹内。
使用方法:保存下面代码为bat脚本,放在视频文件夹执行即可
[Shell] 纯文本查看 复制代码 @if (@a)==(@b) [url=home.php?mod=space&uid=262062]@End[/url] /*
@echo off &setlocal
for /r %%i in (*.mkv *.avi *.mp4 *.mpg *.m2ts *.m4v *.mov *.rm *.rmvb *.flv *.wmv) do (
cscript //nologo //e:jscript "%~fs0" "%%~fi"
)
for %%i in (*.mkv *.avi *.mp4 *.mpg *.m2ts *.m4v *.mov *.rm *.rmvb *.flv *.wmv) do md "%%~ni" && move "%%~i" "%%~ni"
for %%i in (*.nfo) do move "%%~i" "%%~ni"
pause
exit /b
*/
var objXmlDoc = new ActiveXObject('Microsoft.XMLDOM'),
objXsltDoc = new ActiveXObject('Microsoft.XMLDOM'),
objShell = new ActiveXObject('Shell.Application'),
objFSO = new ActiveXObject('Scripting.FileSystemObject'),
objADOS = new ActiveXObject('ADODB.Stream');
objADOS.Type = 2; // adTypeText
var strFullName = WScript.Arguments(0),
strPath = objFSO.GetParentFolderName(strFullName),
strBaseName = objFSO.GetBaseName(strFullName),
objItem = objShell.Namespace(strPath).ParseName(objFSO.GetFileName(strFullName)),
strTitle = getProperty(objItem, 'DocTitle'),
strRuntime = (Math.round(Number(getProperty(objItem, 'Duration')) / 600000000)).toString(),
strS25 = ' ',
objNode;
WScript.StdOut.Write((strBaseName + strS25).substr(0, 25) + ' ' + (strTitle + strS25).substr(0, 25) + ' ' + (' ' + strRuntime).slice(-4) + ' min.\n');
objXmlDoc.loadXML('<?xml version="1.0" encoding="UTF-16"?><movie><title /><runtime /></movie>');
objXsltDoc.loadXML(
'<?xml version="1.0"?>\n' +
'<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\n' +
' <xsl:output method="xml" version="1.0" encoding="UTF-8" standalone="yes" indent="yes" />\n' +
' <xsl:template match="node()|@*">\n' +
' <xsl:copy>\n' +
' <xsl:apply-templates select="node()|@*" />\n' +
' </xsl:copy>\n' +
' </xsl:template>\n' +
'</xsl:stylesheet>');
objXmlDoc.transformNodeToObject(objXsltDoc, objXmlDoc);
objNode = objXmlDoc.documentElement.selectSingleNode('title');
objNode.text = strBaseName;
objNode = objXmlDoc.documentElement.selectSingleNode('runtime');
objNode.text = strRuntime;
objXmlDoc.save(objFSO.BuildPath(strPath, strBaseName + '.nfo'));
function getProperty(objShFI, strPropName) {
objADOS.Open();
objADOS.WriteText(objShFI.ExtendedProperty(strPropName));
objADOS.Position = 0;
var value = objADOS.ReadText();
objADOS.Close();
return value;
}
我已经配置好的脚本:
文件名刮削.zip
(1.18 KB, 下载次数: 231)
|