begarrison
asked on
HTA Application Desktop
I am trying to write my first HTA application.
I want it to do a very simple task, open the window and have a close/exit button.
When the user click the button, it writes the word "FINISHED" to a local text file on the
hard drive and close the program. I know this is very simple, but I have never written a HTA application before.
I want it to do a very simple task, open the window and have a close/exit button.
When the user click the button, it writes the word "FINISHED" to a local text file on the
hard drive and close the program. I know this is very simple, but I have never written a HTA application before.
<html>
<head>
<title>Modal Example</title>
<HTA:APPLICATION
Sysmenu="no"
APPLICATIONNAME="MainModal">
</head>
<script language="VBScript">
Sub ExitProgram
Dim fso
Set fso = CreateObject("scripting.filesystemobject")
Dim txtFile as String
Dim txtstr as TextStream
txtFile = "C:\TheAutomoator\HotFile.txt"
Set txtstr = fso.CreateTextFile(txtFile,True)
txtstr.writeline "Finished"
txtstr.Close
window.close()
End Sub
</script>
<body>
<input id=runbutton type="button" Value="Exit when Finished" onClick="ExitProgram">
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.