本帖最后由 hnfeng 于 2024-10-30 17:50 编辑
试试将ps命令换成
(Get-PSDrive -Name 'C')|out-string
然后在bat里提取 ,例如
Five66 发表于 2024-10-30 17:32 
结果很对,但我水平低,有点没看懂。能否解释一下:
if not defined __unit set __unit=%%e
是如何获取到上一行的 (GB) 的?最后一行不是有 %%e 吗?为什么不是 C:\ | Name Used (GB) Free (GB) Provider Root | | ---- --------- --------- -------- ---- | | C 443.63 509.93 FileSystem C:\COPY |
|