Collection feature

Here's a script for a custom column that will show the VolumeName. It can be used in a Rename command to save the name of volumes that will later get detached.

function OnInit(initData) {
    initData.name = 'VolumeName';
    initData.default_enable = true;
    initData.min_version = '12.0';
    var col = initData.AddColumn();
    col.name = 'VolumeName';
    col.method = 'OnVolumeName';
    col.label = 'VolumeName';
    col.justify = 'left';
    col.autogroup = true;
}

function OnVolumeName(scriptColData) {
    var item = scriptColData.item;

    var srcPath = item.path;
    if (srcPath.drive == 0) return;

    var fso = new ActiveXObject('Scripting.FileSystemObject');
    srcPath.Root();
    var srcDrive = fso.GetDrive(srcPath);
    scriptColData.value = srcDrive.VolumeName;
}

ColumnVolumeName.js.txt (655 Bytes)