Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在windows中更改命令提示符或powershell中的驱动器号_Windows_Powershell_Command Prompt_Disk_Drive - Fatal编程技术网

如何在windows中更改命令提示符或powershell中的驱动器号

如何在windows中更改命令提示符或powershell中的驱动器号,windows,powershell,command-prompt,disk,drive,Windows,Powershell,Command Prompt,Disk,Drive,我想从命令提示符或powershell将计算机磁盘D:\更改为E:\。除了“diskpart”之外还有其他方法吗?假设您所说的“计算机磁盘”不是指系统/启动磁盘,这里有一个使用PowerShell的解决方案。注意这些变量。您可以将它们替换为实际的驱动器号,也可以提前设置它们 Get-Partition -DriveLetter $old | Set-Partition -NewDriveLetter $new 请注意,$old和$new不包含:字符。因此,在您的特定情况下(从D更改为E),您可

我想从命令提示符或powershell将计算机磁盘D:\更改为E:\。除了“diskpart”之外还有其他方法吗?

假设您所说的“计算机磁盘”不是指系统/启动磁盘,这里有一个使用PowerShell的解决方案。注意这些变量。您可以将它们替换为实际的驱动器号,也可以提前设置它们

Get-Partition -DriveLetter $old | Set-Partition -NewDriveLetter $new
请注意,
$old
$new
不包含
字符。因此,在您的特定情况下(从D更改为E),您可以使用以下命令

Get-Partition -DriveLetter D | Set-Partition -NewDriveLetter E

还请注意,您需要管理员权限。因此,以管理员身份运行PowerShell。

什么是对diskpart不利的?这是我的建议。所谓“计算机磁盘”,你是指系统磁盘(即操作系统所在的磁盘,引导磁盘)?这也需要服务器2012/Windows 8及以上版本。由于没有“分区”Get-partition-PartitionNumber 1 | Set partition-NewDriveLetter,因此也无法在DVD/CD驱动器上工作X@Timo您可以使用
新建SmbMapping
(添加新的)和
删除SmbMapping
(删除旧的)。请参见[0]和[1]。[0]: [1]: