hta查看磁盤(pán)空間的腳本
來(lái)源:易賢網(wǎng) 閱讀:1213 次 日期:2014-08-12 17:47:12
溫馨提示:易賢網(wǎng)小編為您整理了“hta查看磁盤(pán)空間的腳本”,方便廣大網(wǎng)友查閱!

<html>

<head>

<title>磁盤(pán)空間查看腳本</title>

<hta:application

     applicationname="磁盤(pán)空間查看腳"     

     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>" & "分區(qū)" & "</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>磁盤(pán)空間查看腳本</b></font><br>

     <font size="2">顯示各磁盤(pán)分區(qū)使用情況(<font color="#FF0000">/MB</font>)</font></font></table>

<body bgcolor="#99CCFF">

     <span id = "DataArea"></span>

</body>

</html> 

保存為hta文件.

更多信息請(qǐng)查看IT技術(shù)專(zhuān)欄

更多信息請(qǐng)查看腳本欄目
易賢網(wǎng)手機(jī)網(wǎng)站地址:hta查看磁盤(pán)空間的腳本
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢(xún)回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門(mén)公布的正式信息和咨詢(xún)?yōu)闇?zhǔn)!

2026國(guó)考·省考課程試聽(tīng)報(bào)名

  • 報(bào)班類(lèi)型
  • 姓名
  • 手機(jī)號(hào)
  • 驗(yàn)證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢(xún) | 簡(jiǎn)要咨詢(xún)須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
云南網(wǎng)警備案專(zhuān)用圖標(biāo)
聯(lián)系電話(huà):0871-65099533/13759567129 獲取招聘考試信息及咨詢(xún)關(guān)注公眾號(hào):hfpxwx
咨詢(xún)QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報(bào)警專(zhuān)用圖標(biāo)