您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 公司方案 > 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
本文标题:vbs判断磁盘类型和检测硬盘剩余空间
链接地址:https://www.777doc.com/doc-2865711 .html