【问题标题】:Windows CE - VBScript command to determine free space of driveWindows CE - VBScript 命令确定驱动器的可用空间
【发布时间】:2015-08-11 13:38:22
【问题描述】:

有谁知道是否存在用于在 Windows CE 中运行的 VBscript 命令来确定驱动器的大小和驱动器上剩余的可用空间?

WinMGMTs 或 fileobject.free 空间等所有命令似乎在 Windows CE 5.0 中都不可用。

这必须是 VBScript,所以我不知道下面的链接将如何工作或可以转换。 How can I determine free space on a Windows CE device?

谢谢!

【问题讨论】:

    标签: vbscript


    【解决方案1】:

    FreeSpacedrive object from Scripting Runtime Library 的属性:

    Dim fso, ddd
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ddd = fso.GetDrive( fso.GetDriveName("C:"))
    WScript.Echo fso.GetDriveName("C:"), FormatNumber( ddd.FreeSpace/1024, 0)
    

    或从dir /-c 输出解析最后一行,可能看起来像

       15 Dir(s)     84849643520 bytes free
    

    (如果不适用于Windows CE 5.0,我将删除我的答案)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-21
      • 1970-01-01
      • 2013-06-19
      • 2014-12-01
      相关资源
      最近更新 更多