View Single Post
Old 05-24-2008   #1 (permalink)
Daz


 
 

vbscript and HTA help

Hi all,

Am trying my hand at my first HTA and would like to ask for some help
with a process i am tying to implement...

I would like to select one option of 3 options for a given object and
then once all the objects have had a selection, output the object.name
to a text file maching the choice... so if i picked disable for object
1 and automatic for object 2 and manual for object 3 and automatic for
object 4 - i would have 3 text files with the object name on a line.
So the output file for automatic (lets call it automatic.txt) would
have object1 and on the next line object4.

I think you get what i mean....

here is the test hta code i am working with at the moment...

<html>
<head>
<title>test</title>
<hta:application
ID="objHTA"
VERSION="1.0"
icon="simple.ico"
applicationName="test"
border=dialog
borderStyle=normal
caption=yes
contextMenu=yes
innerBorder=yes
maximizeButton=yes
minimizeButton=yes
navigable=yes
scroll=no
selection=yes
showInTaskBar=yes
sysMenu=yes
singleInstance=yes
windowState=normal
/>
<script language="vbscript">

Sub Window_Onload
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From
Win32_DesktopMonitor")
For Each objItem in colItems
intHorizontal = objItem.ScreenWidth
intVertical = objItem.ScreenHeight
Next
intLeft = (intHorizontal - 800) / 2
intTop = (intVertical - 600) / 2
window.resizeTo 800,600
window.moveTo intLeft, intTop
window.focus()
End Sub

</script>
</head>

<body>
<table width="200" border="1">
<tr>
<td>object 1
<label></label></td>
</tr>
<tr>
<td><input type='radio' name='disable' id='disable2' />
Disable
</label>
<label>
<input type='radio' name='radio' id='Automatic2'
value='Automatic' />
Automatic</label>
<label>
<input type='radio' name='radio' id='Manual2' value='Manual' /
Quote:

>
Manual</label></td>
</tr>
<tr>
<td>object 2</td>
</tr>
<tr>
<td><input type='radio' name='disable' id='disable3' />
Disable
</label>
<label>
<input type='radio' name='radio' id='Automatic3'
value='Automatic' />
Automatic</label>
<label>
<input type='radio' name='radio' id='Manual3' value='Manual' /
Quote:

>
Manual</label></td>
</tr>
</table>
</body>
</html>


I would greatly appreciate your help

Cheers,
Daz
My System SpecsSystem Spec