如何通过Windows命令提示符或Power shell命令在具有Windows操作系统的远程计算机上找到os
根驱动器(例如C或D等(的字母。
在本地 pc 中,">设置系统根"命令可以获取 windows 根驱动器,但我希望这个等效命令用于远程计算机......
query WMI, Win32_OperatingSystem class;
操作系统驱动器号
Get-CimInstance -Class Win32_OperatingSystem -ComputerName localhost -Property SystemDrive | Select-Object -ExpandProperty SystemDrive
或
Get-WmiObject -Class Win32_OperatingSystem -ComputerName localhost -Property SystemDrive | Select-Object -ExpandProperty SystemDrive
视窗目录
Get-CimInstance -Class Win32_OperatingSystem -ComputerName localhost -Property WindowsDirectory | Select-Object -ExpandProperty WindowsDirectory
或
Get-WmiObject -Class Win32_OperatingSystem -ComputerName localhost -Property WindowsDirectory | Select-Object -ExpandProperty WindowsDirectory