Skip to content

setVolumeLabel

xiao edited this page Nov 8, 2025 · 1 revision

change label for the specific volume.

usage

callback:

fswin.setVolumeLabel(path, label, callback);

async:

var result = await fswin.setVolumeLabelAsync(volume, label);

sync:

var result = fswin.setVolumeLabelSync(volume, label);
  • path is the root path of a volume.
  • label is a string you want to label the volume.
  • callback is a function that takes only one argument result.
  • result is a boolean value to indicate whether the operation is succeeded.

usage

var fswin = require('fswin');
var path = 'c:\\';

//sync
console.log(fswin.setVolumeLabelSync(path, 'test1'));

//async
fswin.setVolumeLabel(path, 'test2', console.log);

Clone this wiki locally