首页 > 编程 > HTML > 正文

hta查看磁盘空间的脚本

2024-08-26 00:15:48
字体:
来源:转载
供稿:网友
<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>"
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表