Come recuperare dettagli come titolo, sottotitolo e lunghezza di un file MP3 tramite riga di comando?


-4

Voglio creare un file batch in grado di elencare tutti i dettagli dei file mp3 presenti in una directory in un file. Se dico wmic, non ho i dettagli dell'album o dell'artista.


1
Quindi cosa ottieni e come si usa WMIC?
TheUser1024

sto usando la sintassi come file di dati wmic dove nome = 'C: \\% USERNAMAE% \\ Download \\ 123.mp3'
Komal Chauhan

Sei sicuro che leggere l'id3tags sia qualcosa che può essere fatto con WMIC? Mi sembra che questo non sia lo strumento giusto, tuttavia potrei sbagliarmi. Perché l'hai scelto in primo luogo?
TheUser1024

Risposte:


1

la lunghezza può essere ottenuta con tooltipInfo.bat

@if (@X)==(@Y) @end /* JScript comment
    @echo off

    rem :: the first argument is the script name as it will be used for proper help message
    cscript //E:JScript //nologo "%~f0" %*

    exit /b %errorlevel%

@if (@X)==(@Y) @end JScript comment */

////// 
FSOObj = new ActiveXObject("Scripting.FileSystemObject");
var ARGS = WScript.Arguments;
if (ARGS.Length < 1 ) {
 WScript.Echo("No file passed");
 WScript.Quit(1);
}
var filename=ARGS.Item(0);
var objShell=new ActiveXObject("Shell.Application");
/////


//fso
ExistsItem = function (path) {
    return FSOObj.FolderExists(path)||FSOObj.FileExists(path);
}

getFullPath = function (path) {
    return FSOObj.GetAbsolutePathName(path);
}
//

//paths
getParent = function(path){
    var splitted=path.split("\\");
    var result="";
    for (var s=0;s<splitted.length-1;s++){
        if (s==0) {
            result=splitted[s];
        } else {
            result=result+"\\"+splitted[s];
        }
    }
    return result;
}


getName = function(path){
    var splitted=path.split("\\");
    return splitted[splitted.length-1];
}
//

function main(){
    if (!ExistsItem(filename)) {
        WScript.Echo(filename + " does not exist");
        WScript.Quit(2);
    }
    var fullFilename=getFullPath(filename);
    var namespace=getParent(fullFilename);
    var name=getName(fullFilename);
    var objFolder=objShell.NameSpace(namespace);
    var objItem=objFolder.ParseName(name);
    //https://msdn.microsoft.com/en-us/library/windows/desktop/bb787870(v=vs.85).aspx
    WScript.Echo(fullFilename + " : ");
    WScript.Echo(objFolder.GetDetailsOf(objItem,-1));

}

main();

Accetta un singolo argomento - il percorso del file. Output di esempio:

E:\MP3.mp3
icks, Trenches And Swords.mp3 :
Item type: MP3 Format Sound
Size: 3.22 MB
Contributing artists: Pint Shot Riot
Length: 00:03:31
Availability: Available offline
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.