足球游戏_中国足彩网¥体育资讯$

hta查看磁盘空间的脚本
来源:易贤网 阅读:675 次 日期:2016-06-17 09:42:40
温馨提示:易贤网小编为您整理了“hta查看磁盘空间的脚本”,方便广大网友查阅!

<html>

<head>

<title>磁盘空间查看脚本</title>

<hta:application

     applicationname=磁盘空间查看脚     

     border=dialog

     borderstyle=normal

     caption=yes

     contextmenu=no

     maximizebutton=no

     minimizebutton=yes

     navigable=no

     scroll=yes

     selection=no

     showintaskbar=yes

     singleinstance=yes

     sysmenu=yes

     version=1.0

     windowstate=normal

>

<script language=vbscript>

<!-- insert code, subroutines, and functions here -->

window.resizeto 500, 420

     ileft=(window.screen.width-500)/2

     itop=(window.screen.height-420)/2         

     window.moveto ileft,itop                             

sub window_onload 

     getdiskspace 

end sub

sub getdiskspace

const hard_disk = 3

const size = 1048576

strcomputer = .

set objwmiservice = getobject(winmgmts: _

     & {impersonationlevel=impersonate}!\\ & strcomputer & \root\cimv2)

set coldisks = objwmiservice.execquery _

     (select * from win32_logicaldisk where drivetype =  & hard_disk & )

     strhtml = <table align=center width=95% bordercolor=#698cc2 border='1' cellspacing='0' cellpadding='1'>         

                     strhtml = strhtml & <tr>

             strhtml = strhtml & <td width=110px align=center><font size=2><b> & 分区 & </b></td>

             strhtml = strhtml & <td width=110px align=center><font size=2><b> & 容量 & </b></td>

             strhtml = strhtml & <td width=110px align=center><font size=2><b> & 已用 & </b></td>

             strhtml = strhtml & <td width=110px align=center><font size=2><b> & 未用 & </b></td>

             strhtml = strhtml & <td width=110px align=center><font size=2><b> & 空闲 & </b></td>

     

for each objdisk in coldisks     

intfreespace = objdisk.freespace/size

inttotalspace = objdisk.size/size

pctfreespace = intfreespace/size/ inttotalspace/size

inffulin = inttotalspace-intfreespace

deviceid = objdisk.deviceid

             strhtml = strhtml & <tr>

             strhtml = strhtml & <td width=110px align=center> & deviceid & </td>

             strhtml = strhtml & <td width=110px align=right> & formatnumber(inttotalspace,2,-1,-1,0) & </td>

             strhtml = strhtml & <td width=110px align=right><font color=#db2c00> & formatnumber(inffulin,2,-1,-1,0) & </td>

             strhtml = strhtml & <td width=110px align=right><font color=#008080> & formatnumber(intfreespace,2,-1,-1,0) & </td>

             strhtml = strhtml & <td width=110px align=right> & formatpercent(intfreespace/inttotalspace) & </td>

next

strhtml = strhtml & </table>

dataarea.innerhtml = strhtml

end sub

</script>

</head>

<body>

<!-- html goes here -->

<table align=center width=95%><font color=#c63358><b>磁盘空间查看脚本</b></font><br>

     <font size=2>显示各磁盘分区使用情况(<font color=#ff0000>/mb</font>)</font></font></table>

<body bgcolor=#99ccff>

     <span id = dataarea></span>

</body>

</html> 

保存为hta文件.

中国足彩网信息请查看脚本栏目
易贤网手机网站地址:hta查看磁盘空间的脚本
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!
关于我们 | 联系我们 | 人才招聘 | 网站声明 | 网站帮助 | 非正式的简要咨询 | 简要咨询须知 | 加入群交流 | 手机站点 | 投诉建议
工业和信息化部备案号:滇ICP备2023014141号-1 足球游戏_中国足彩网¥体育资讯$ 滇公网安备53010202001879号 人力资源服务许可证:(云)人服证字(2023)第0102001523号
云南网警备案专用图标
联系电话:0871-65317125(9:00—18:00) 获取招聘考试信息及咨询关注公众号:hfpxwx
咨询QQ:526150442(9:00—18:00)版权所有:易贤网
云南网警报警专用图标