请问 [控制面板]-[管理工具]-[计算机管理]-[磁盘管理] 中的"更改驱动器名和路径"的功能是如何实现的呢?

解决方案 »

  1.   

    DeviceIoControl to the change
      

  2.   

    http://www.cnitblog.com/wangk/archive/2006/01/10/6106.html
      

  3.   

    晕倒

    GetVolumeNameForVolumeMountPoint
    DeleteVolumeMountPoint
    SetVolumeMountPoint
      

  4.   

    Assigning a Drive Letter to a Volume
    You can assign a drive letter (for example, x:\) to a local volume using SetVolumeMountPoint, provided there is no volume already assigned to that drive letter. If the local volume already has a drive letter then SetVolumeMountPoint will fail. To handle this, first delete the drive letter using DeleteVolumeMountPoint. For example code, see Editing Drive Letter Assignments.
    The system supports at most one drive letter per volume. Therefore, you cannot have C:\ and F:\ represent the same volume.Caution  Deleting an existing drive letter and assigning a new one may break existing paths, such as those in desktop shortcuts. It may also break the path to the program making the drive letter changes. With Windows virtual memory management, this may break the application, leaving the system in an unstable and possibly unusable state. It is the program designer's responsibility to avoid such potential catastrophes.
      

  5.   

    Editing Drive Letter Assignments
    The code example in this topic shows you how to add or remove persistent drive letter assignments. These drive letter assignments persist through system shutdown. For more information, see Assigning a Drive Letter to a Volume. 
    The code example uses the following functions: DefineDosDevice, DeleteVolumeMountPoint, GetVolumeNameForVolumeMountPoint, and SetVolumeMountPoint.
    Please search "Editing Drive Letter Assignments" in MSDN to see the example code.
      

  6.   

    回楼上zhangshengyuGetVolumeNameForVolumeMountPoint
    DeleteVolumeMountPoint
    SetVolumeMountPoint
    ..........你说的那些函数我有用过,能列决出来的所有挂接点都是在HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices项下内容,我更想知道的是映射驱动器路径的问题,比如说我将J盘(U盘)映射成本地的一个文件夹C:\mount001\,但是我用你说的那类函数不能列决出c:\mount001\来。