外部驱动器号-备份 [英] External Drive Letter - Backup

查看:104
本文介绍了外部驱动器号-备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个PowerShell脚本,该脚本将使用robocopy将多个文件夹从我的Vista驱动器备份到外部USB驱动器.
Windows不保证它将始终为外部驱动器分配相同的驱动器号.
解决此问题的最佳方法是什么?
如何编写目标路径?

I am writing a PowerShell script that will back up several folders from my Vista drive to an external USB drive, using robocopy.
Windows does not guarantee that it will always assign the same drive letter to the external drive.
What is the best way to get around this problem?
How do I code the destination paths?

谢谢.

推荐答案

Windows可以更改分配给USB驱动器的驱动器号.
进行此备份的正确方法是将USB驱动器安装在空目录中.它不仅为交换的存储增加了一些一致性,而且还允许在Windows桌面上提供持久的快捷方式.

Windows could change that drive letter assigned to your USB drive.
The correct way to do this backup is mounting the USB drive in an empty directory. Not only does it add some consistency to swapped storage, it also allows for a persistent shortcut on a Windows desktop.

方法如下:

  1. 从Windows的运行/开始搜索"框中运行"diskmgmt.msc",
  2. 右键单击插入的驱动器,然后选择更改驱动器号" 和路径."
  3. 删除分配给驱动器的当前驱动器号.
  4. 单击添加"按钮
  5. 选择装入"到下面的空NTFS文件夹中,然后单击 浏览.
  6. 现在导航至要分配USB驱动器的子文件夹 并确认作业.
  1. Run "diskmgmt.msc" from Windows' Run/Start Search box,
  2. Right-click on your plugged-in drive and choose "Change Drive Letter and Paths."
  3. Remove the current drive letter assigned to your drive.
  4. Click on the Add button
  5. Select Mount into the following empty NTFS folder and click on browse.
  6. Now navigate to the subfolder that you want to assign the USB drive to and confirm the assignment.

从现在开始,可以从该文件夹访问USB驱动器(如果已连接到计算机).
现在,您可以更改脚本以选择包含已安装驱动器的文件夹作为目标文件夹,而无需考虑驱动器号的持久性.

The USB drive will from now on be accessible from that folder (if it is connected to the computer of course).
Now you can change your script to select, as destination folder, the folder with the mounted drive and forget the drive letter persistence.

这篇关于外部驱动器号-备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆