This is a simple Space Calculator utility that lets you add various byte sizes together.
Just copy the code into a text file and rename it with an .hta extension.
Enjoy.
<html>
<head>
<title>Space Calc</title>
<HTA:APPLICATION
ID="HTASpaceCalc"
APPLICATIONNAME="HTA-SpaceCalc"
SCROLL="no"
SINGLEINSTANCE="no"
WINDOWSTATE="normal"
>
<style>
BODY
{
background-color: buttonface;
font-family: Helvetica;
font-size: 8pt;
margin-top: 8px;
margin-left: 8px;
margin-right: 8px;
margin-bottom: 3px;
}
</style>
<SCRIPT language="VBScript">
Sub DoCalc
totamt = 0
amt = 0
amt2 = 0
If Isnumeric(startamt.Value) AND (isnumeric(Addamt.Value) or Trim(Addamt.Value) = "") Then
If R1(2).checked Then
amt = startamt.value * (1024*1024*1024*1024)
ElseIf R1(1).Checked Then
amt = startamt.value * (1024*1024*1024)
ElseIf R1(0).Checked Then
amt = startamt.value * (1024*1024)
End If
If Trim(Addamt.Value) = "" Then
amt2 = 0
Else
If R2(2).checked Then
amt2 = addamt.value * (1024*1024*1024*1024)
ElseIf R2(1).Checked Then
amt2 = addamt.value * (1024*1024*1024)
ElseIf R2(0).Checked Then
amt2 = addamt.value * (1024*1024)
End If
End If
totamt = amt + amt2
newtotbytes.value = totamt
newtotkilo.value = totamt / 1024
newtotmega.value = totamt / (1024 * 1024)
newtotgiga.value = totamt / (1024 * 1024 * 1024)
newtottera.value = totamt / (1024 * 1024 * 1024 * 1024)
Else
Msgbox "Enter numeric values only"
End If
End Sub
Sub startup
'*** Put window in front, resize, set the month to the current month and self run routine
self.focus
self.ResizeTo 470,510 'w,h
StartAmt.focus
End sub
</SCRIPT>
</head>
<BODY onload="startup">
<H2 ID="Heading" align="left">Space Calc</H2>
<ul>
<li>
<p align="left">Enter Starting Amount, add additional amount and press
RunScript</li>
<li>
<p align="left">Leave Add amount Blank to see starting amount converted to
other amount forms</li>
</ul>
<p align="left">Starting Amount <input type="text" name="StartAmt" size="10">
<input type="radio" value="V1" name="R1">megabytes<input type="radio" value="V2" checked name="R1">gigabytes
<input type="radio" value="V3" name="R1">terabytes</p>
<p align="left">Add this amount <input type="text" name="AddAmt" size="10">
<input type="radio" value="D1" name="R2" checked>megabytes<input type="radio" value="D2" name="R2">gigabytes
<input type="radio" value="D3" name="R2">terabytes</p>
<P>
<textarea rows="1" name="NewTotbytes" cols="25"></textarea>bytes<P>
<textarea rows="1" name="NewTotkilo" cols="25"></textarea>kilobytes<P>
<textarea rows="1" name="NewTotmega" cols="25"></textarea>megabytes<P>
<textarea rows="1" name="NewTotgiga" cols="25"></textarea>gigabytes<P>
<textarea rows="1" name="NewTottera" cols="25"></textarea>terabytes<br>
<br>
<input type="button" name="OKButton" onclick="DoCalc" value="RunScript" ><p><input type="button" value="Exit" onclick="window.close" name="B3"></p>
</BODY>
</html>