How to change Disk's volume Serial

Any one can help me with C# code to change Volume Serial of a disk drive.

Thank you in advance



Answer this question

How to change Disk's volume Serial

  • wencey

    You can change the VolumeLabel of a drive by the following example...but i m not sure about volume serial

    System.IO.DriveInfo d = new System.IO.DriveInfo("E");

    d.VolumeLabel = "NewLabel";


  • ImGivingUp

    using System;

    using System.Collections.Generic;

    using System.Text;

    using System.Management;

     

    namespace WMIDiskSerial

    {

    class Program

    {

    static void Main(string[] args)

    {

    ManagementObject diskObj = new ManagementObject("win32_logicaldisk.deviceid=\"c:\"");

    diskObj.Get();

    Console.WriteLine(diskObj["VolumeSerialNumber"].ToString());

    Console.ReadLine();

    }

    }

    }



  • TommyGL

    Oh sorry, you meant "change". I don't know...

  • How to change Disk's volume Serial