creating virtual hard Drive

前端 未结 4 703
你的背包
你的背包 2020-12-07 17:09

how can I create Virtual Hard Drive (like Z:) that store it\'s files on physical hard drive (Like C:\\Files).

4条回答
  •  醉梦人生
    2020-12-07 17:43

    Not sure how to do this in C# but this should help you:

    Ive just tested this and works perfect

    On my computer have 1 hard drive devised into 2, C: & D:, going into D: i have a folder called Backup, if you right click the folder and click the Share Tab, you will see Network Path.. On my pc it looks like \\Robert-home\backup

    I then proceeded to CMD and executed the following command

    NET USE Z: \\Robert-home\backup
    

    Witch successfully map the contents of D:\backup to Z:

    Im sure you can complete such a task within C#..

    I usually use this method at work for client support to transfer and backup files before new consoles are issued to them.

提交回复
热议问题