Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


does anyone here use HTAs?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,2386
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> does anyone here use HTAs?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 does anyone here use HTAs? - 3/17/2005 12:04:10 PM   
  toddio

 

Posts: 10
Score: 0
Joined: 3/16/2005
From: USA
Status: offline
Does anybody use HTAs, or do people shun them because they are associated with viruses? VBScript is associated with viruses, but people apparently use that. =)

HTA means "HTML application" or "hypertext application". I find HTAs to be excellent for small utilities that need a little bit of a user interface. Everything is stored in one text file: script code, style sheet, html layout.

The most recent one I made compares the output of a database batch transfer system with the Excel spreadsheet that defines the format. It generates a monstrous HTML page of several tables, one per record of the output, matching each field up with the field name coming from the spreadsheet. It made it very easy to detect where field mismatches were occuring. I was also able to send the whole utility to the state office that receives the transfer file, so they could do similar testing on their end. It helped determine that their file reading routines weren't getting everything right. =)

I also wrote a very simple text-file based chat program as an HTA. Multiple people on the same network pointing to the same text file will see all of eachothers comments. It reads an Access database to convert network usernames into nicknames and look up other info related to each user.

The Scriptomatic on the TechNet website runs as an HTA too, as an example of a useful tool from a "legitimate" source.
http://www.microsoft.com/technet/scriptcenter/default.mspx

I'd be interested to hear if others are using these, and what kinds of apps and utilities they are being use for.

- toddio
 
 
Post #: 1
 
 Re: does anyone here use HTAs? - 3/17/2005 1:43:01 PM   
  giantlunarmoth

 

Posts: 47
Score: 0
Joined: 3/9/2005
From:
Status: offline
I'm all about HTA dev these days. In fact, it's pretty much the reason I recently got into VBScript. Scriptomatic was one of the first I looked at, and was quite impressed by it. The biggest plus for me in HTAs is their access to Windows' "local zone", which was dramatically restricted with XP SP2 (and rightly so). The potential scope of these install-free apps is quite attractive, especially in an a LAN or Intranet context. I'm still pretty green with em, but have found many normal app dev constraints do not apply...using the user's resources is a plus, and using CSS for a GUI is a joy! I'm interested in your text-chat app, and what means you're using get new data populating in each user's instance of the app.

(in reply to toddio)
 
 
Post #: 2
 
 Re: does anyone here use HTAs? - 3/18/2005 12:10:11 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Whereever I need userinput that requires more than 1 line, i.e. username/password. I have built an unattended OS setup based off of WinPE that has a "gui" built with an HTA. A while ago I built a script that parsed through a folder of MP3's, extracted the id info then wrote a HTA that showed the original filename and the new file name that was based off of the info taken from the ID tag. Why I did this when there are apps that do it I don't know.

(in reply to toddio)
 
 
Post #: 3
 
 Re: does anyone here use HTAs? - 3/18/2005 1:17:53 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
Is there any good documentation on building HTA's? I would really like to get into that, or is it better to use VB?

(in reply to toddio)
 
 
Post #: 4
 
 Re: does anyone here use HTAs? - 3/18/2005 2:01:04 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Here are a couple URL's from MS's site. An HTA is really a HTML page renamed. I have writte a HTML page in frontpage, set my tables the way I wanted, then renamed it to .hta and it worked. What you get from an HTA is that it does not use the IE security as it can only run locally.

http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp
http://msdn.microsoft.com/workshop/author/hta/hta_node_entry.asp
http://msdn.microsoft.com/workshop/author/hta/reference/objects/hta.asp

(in reply to toddio)
 
 
Post #: 5
 
 Re: does anyone here use HTAs? - 3/18/2005 2:26:03 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
I really just don't understand how to assign variables to tables or anything. I have a script that loops to collect mailbox information. I have it creating a CSV, but I really would like to have it be an HTA so others could use it from IE. So I am just trying to learn how to do that.

(in reply to toddio)
 
 
Post #: 6
 
 Re: does anyone here use HTAs? - 3/18/2005 2:34:06 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
This is what I have so far. I would like the variables to dynamically populate the cells, but again, I don't know how to do that. It starts to work, then errors out on line 54.

<HTML> <HEAD>
<TITLE>
Testing out HTA
</TITLE>

<HTA:APPLICATION
ID = "oApp"
APPLICATIONNAME = "HTA Test"
BORDER = "thick"
CAPTION = "yes"
ICON = "app.ico"
SHOWINTASKBAR = "yes"
SINGLEINSTANCE = "yes"
SYSMENU = "yes"
WINDOWSTATE = "normal"
SCROLL = "yes"
SCROLLFLAT = "yes"
VERSION = "1.0"
INNERBORDER = "yes"
SELECTION = "no"
MAXIMIZEBUTTON = "yes"
MINIMIZEBUTTON = "yes"
NAVIGABLE = "yes"
CONTEXTMENU = "yes"
BORDERSTYLE = "normal"
>

<script language="vbscript">

strDispName = "Mailbox display name"
strDelete = "Delete messages size extended"
strMailSize = "Mailbox Size"
strTotalItems = "Total Items"

On Error Resume Next

strComputer = "mlnusa-exch1"

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\ROOT\MicrosoftExchangeV2")

Set colItems = objWMIService.ExecQuery _
("Select * from Exchange_Mailbox")

For Each objItem in colItems
strName = objItem.MailboxDisplayName
strDelSize = objItem.DeletedMessageSizeExtended
strSize = objItem.Size
strTotalCount = objItem.TotalItems
Next
objFile.Close

</script>

</HEAD>

<BODY scroll="yes" onLoad="Init()">
<table width="200" border="1">
<tr>
<td nowrap><div align="center"><script language="vbscript">document.write strDispName</script></div></td>
<td nowrap><div align="center"><script language="vbscript">document.write strDelete</script></div></td>
<td nowrap><div align="center"><script language="vbscript">document.write strMailSize</script></div></td>
<td nowrap><div align="center"><script language="vbscript">document.write strTotalItems</script></div></td>
</tr>
<tr>
<td nowrap><div align="center"><script language="vbscript">document.write strName</script></div></td>
<td nowrap><div align="center"><script language="vbscript">document.write strDelSize</script></div></td>
<td nowrap><div align="center"><script language="vbscript">document.write strSize</script></div></td>
<td nowrap><div align="center"><script language="vbscript">document.write strTotalCount</script></div></td>
</tr>
</table>

</BODY>

</HTML>

(in reply to toddio)
 
 
Post #: 7
 
 Re: does anyone here use HTAs? - 3/18/2005 3:48:49 AM   
  giantlunarmoth

 

Posts: 47
Score: 0
Joined: 3/9/2005
From:
Status: offline
How about reading the whole csv file straight into a div? The following will browse for a file, "read" it, and display its contents a div:


      
The browse feature is just to demo the readfile function. You can change "fname.value" in

       to match the path\fileneame of your csv, and remove
       from the body. If you really wanted to write different lines into separate table cells, you could maybe try putting divs in all of your cells, and using a ReadLine type of operation (but there's probably a better way ).

(in reply to toddio)
 
 
Post #: 8
 
 Re: does anyone here use HTAs? - 3/18/2005 4:01:43 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
Seems to work nicely. I just really haven't worked with HTML much so integrating script into is while learning it at the same time is pretty tough.

(in reply to toddio)
 
 
Post #: 9
 
 Re: does anyone here use HTAs? - 3/18/2005 5:12:29 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Esnmb,

I was wondering why you had scriptlanguage inside the HTML tags? I am not the strongest when it comes to coding HTML but I do not think that you need that.

here is an example of an HTA page that is gathering some info on page load.


      

(in reply to toddio)
 
 
Post #: 10
 
 Re: does anyone here use HTAs? - 3/18/2005 5:15:53 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
I have it there because I have no clue as to what I am doing... :(
I don't know how to reference VBScript variable througout the HTML unless I add the whole <script. . . .

(in reply to toddio)
 
 
Post #: 11
 
 Re: does anyone here use HTAs? - 3/18/2005 5:48:18 AM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
Here is another example of how you can update the hta with a button click.

Also, check out www.blooberry.com. This is a site that I refered to many a time when I was developing my hta's.


      

(in reply to toddio)
 
 
Post #: 12
 
 Re: does anyone here use HTAs? - 3/18/2005 7:42:34 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
Excellent. Thanks!

(in reply to toddio)
 
 
Post #: 13
 
 Re: does anyone here use HTAs? - 3/18/2005 11:45:36 AM   
  toddio

 

Posts: 10
Score: 0
Joined: 3/16/2005
From: USA
Status: offline
GLM: > I'm interested in your text-chat app, and what means you're using get new data populating in each user's instance of the app.

TextChat uses a timer to reread the text file and redraw the display every 10th of a second. I've only ever had a few users on it at a time, so haven't seen heavy use. I mainly wrote it to see how much activity it would take to cause a collision.

I will clean it up some and post a working copy on my website next week. It's too big for a forum message. But I'll try to put together a demo to show how I write and read the file.


mbouchard: > (app to rename MP3s from ID info) Why I did this when there are apps that do it I don't know.

Because DIY is so much more fun, I'm guessing. That's why I do it. =)


esnmb:

Another useful site with some HTA info is the TechNet Scripting archive, which Mike points to the top of.

- The Script Center Script Repository
- http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx

- Script Repository > Scripting Techniques > Web Pages and HTAs
- http://www.microsoft.com/technet/scriptcenter/scripts/misc/web/default.mspx

(in reply to toddio)
 
 
Post #: 14
 
 Re: does anyone here use HTAs? - 4/9/2005 12:41:26 PM   
  TNO


Posts: 1240
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
esnmb - " I really just don't understand how to assign variables to tables or anything. I have a script that loops to collect mailbox information. I have it creating a CSV, but I really would like to have it be an HTA so others could use it from IE. So I am just trying to learn how to do that."

Have you tried using TDC (Tabular Data Control) to read directly from the CSV into the table?

(in reply to toddio)
 
 
Post #: 15
 
 Re: does anyone here use HTAs? - 4/9/2005 2:51:11 PM   
  giantlunarmoth

 

Posts: 47
Score: 0
Joined: 3/9/2005
From:
Status: offline
I've looked into this as well...some decent info can be found here: http://msdn.microsoft.com/library/default.asp?url=/workshop/database/tdc/overview.asp

(in reply to toddio)
 
 
Post #: 16
 
 Re: does anyone here use HTAs? - 4/30/2005 4:02:10 AM   
  TNO


Posts: 1240
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
quote:
Originally posted by toddio

GLM: > I'm interested in your text-chat app, and what means you're using get new data populating in each user's instance of the app.

TextChat uses a timer to reread the text file and redraw the display every 10th of a second. I've only ever had a few users on it at a time, so haven't seen heavy use. I mainly wrote it to see how much activity it would take to cause a collision.

I will clean it up some and post a working copy on my website next week. It's too big for a forum message. But I'll try to put together a demo to show how I write and read the file.



What is your website? I'm curious on how you implemented vbscript to do this.

(in reply to toddio)
 
 
Post #: 17
 
 RE: Re: does anyone here use HTAs? - 3/27/2006 3:16:48 PM   
  mravi_prakash

 

Posts: 15
Score: 0
Joined: 3/27/2006
Status: offline
can u help ,me .

i need to have a database connection using MYSQL to my HTA file ...
i am new to the HTA html application i dont know much ..of it ..
can u please send me a sample code of how to access the data from the database n show in HTA file ..
its very urgent for me please

_____________________________

m. Ravi Prakash
B.E computer science
software engineer

(in reply to mbouchard)
 
 
Post #: 18
 
 RE: Re: does anyone here use HTAs? - 3/27/2006 4:35:29 PM   
  rOOs


Posts: 63
Score: 0
Joined: 2/28/2006
From: Switzerland
Status: offline
This is for MSSql...

strConnectionString = "Provider=sqloledb;Data Source=servername;Initial Catalog=DB;Trusted_Connection=yes;"
Set objConn = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
Set rs = CreateObject("ADODB.Recordset")

  objConn.Open strConnectionString
     Query = "SELECT * FROM table"
rs.Open Query, objConn, 1
rs.MoveFirst
Do Until rs.EOF

' output here...

Loop
rs.Close
objConn.Close


If you want to change it to mySQL google for "VBScript Connectionstring mySQL" or go to www.connectionstring.com (or somewhat like this)


(in reply to mravi_prakash)
 
 
Post #: 19
 
 RE: Re: does anyone here use HTAs? - 3/27/2006 5:16:04 PM   
  mravi_prakash

 

Posts: 15
Score: 0
Joined: 3/27/2006
Status: offline
strConnectionString = "Provider=sqloledb;Data Source=mysql;Initial Catalog=DB;Trusted_Connection=yes;"
Set objConn = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
Set rs = CreateObject("ADODB.Recordset")

objConn.Open strConnectionString
Query = "SELECT * FROM time"
rs.Open Query, objConn, 1
rs.MoveFirst
Do Until rs.EOF
msgbox(rs)

Loop
rs.Close
objConn.Close


this is wht i typed .. but no out put came .. it just displayed me a text wht i typed ...

i want my database to be access from a MSQL which runs on the stand alone ..system ...
can u please help its urgent


_____________________________

m. Ravi Prakash
B.E computer science
software engineer

(in reply to rOOs)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> does anyone here use HTAs? Page: [1] 2   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts