如何通过Windows命令提示符或power shell命令在Windows操作系统的远程计算机上找到os
根驱动器的字母(例如C或D等...)。
在本地电脑中,“set systemroot”命令可以获取Windows根驱动器,但我想要远程计算机的这个等效命令...
查询WMI,Win32_OperatingSystem类;
OS驱动器号
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
Windows目录
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