vbs判断磁盘类型和检测硬盘剩余空间

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

FunctionShowDriveType(drvpath)Dimfso,d,tSetfso=CreateObject(Scripting.FileSystemObject)Setd=fso.GetDrive(fso.GetDriveName(drvpath))SelectCased.DriveTypeCase0t=UnknownCase1t=Removable'移动硬盘Case2t=Fixed'硬盘Case3t=Network'网络硬盘Case4t=CD-ROMCase5t=RAMDisk'RAMEndSelectShowDriveType=Drive&d.DriveLetter&:-&tEndFunctionFunctionShowFreeSpace(drvPath)Dimfso,d,sSetfso=CreateObject(Scripting.FileSystemObject)Setd=fso.GetDrive(fso.GetDriveName(drvPath))'d为F:s=Drive&UCase(drvPath)&-s=s&d.VolumeName&s=s&FreeSpace:&FormatNumber(d.FreeSpace/1024,0)s=s&KBytesShowFreeSpace=sEndFunctionDimmessagemessage=ShowDriveType(F:\Programming\Applications)MsgBoxmessagemessage=ShowFreeSpace(F:\Programming\Applications)MsgBoxmessage

1 / 2
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功