将我的电脑磁盘系统信息写入文本文件

上一篇 / 下一篇  2007-08-20 22:03:28 / 个人分类:QTP学习笔记

Dim a1,a2,a3,a4
Set a1=createobject("scrīpting.filesystemobject")
Set a2=a1.opentextfile("e:\info.txt",2,true)
Set a3=a1.drives
For each a4 in a3
        If a4.isready Then
                a2.writeline a4.RootFolder.Type & a4.driveletter & "的文件系统是 '"&a4.filesystem&"'"
    else
            a2.writeline"the disk of " & a4.driveletter & " is not ready"
        End If
Next
a2.close

运行后e:\info.txt文件内容如下:

本地磁盘C的文件系统是 'NTFS'
本地磁盘D的文件系统是 'NTFS'
本地磁盘E的文件系统是 'FAT32'
本地磁盘F的文件系统是 'NTFS'
the disk of G is not ready
the disk of H is not ready


TAG: QTP学习笔记

 

评分:0

我来说两句

日历

« 2024-05-14  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 26174
  • 日志数: 17
  • 图片数: 2
  • 建立时间: 2007-01-16
  • 更新时间: 2007-11-27

RSS订阅

Open Toolbar