必须引用 MSSCRRUN.DLL才可以使用

解决方案 »

  1.   

    引用Microsoft Scripting Runtime
      

  2.   

    必须先在工程菜单中添加一个引用 “Microsoft Scripting Runtime"
    然后才可以在VB中使用:
    例:
    dim fso as new filesystemobject
     set fso=createobject("Scripting.filesystemobject")
      

  3.   

    FSO -- FileSystemObject 对象
    工程->引用Microsoft Scripting Runtime
    编写代码时,你就可以看到提示了。
      

  4.   

    Dim fs As Object, d As Object
        Set fs = CreateObject("Scripting.FileSystemObject")
        On Error Resume Next
        For Each d In fs.Drives
            Debug.Print d.driveletter & ": 总空间:" & d.TotalSize & "字节,剩余空间:" & d.FreeSpace & "字节"
        Next