Home > HTA > Write a basic HTA

Write a basic HTA


The code below will create a basic HTA that has a link to open Notepad.
 
<html>
<head>
<HTA:APPLICATION ID="oHTA"
      VERSION="1.0"
     APPLICATIONNAME="AmPost"
     BORDER="thin"
     BORDERSTYLE="normal"
     CAPTION="yes"
     CONTEXTMENU="no"
     ICON=""
     INNERBORDER="yes"
     MAXIMIZEBUTTON=no"
     MINIMIZEBUTTON="no"
     NAVIGABLE="yes"
     SCROLL="no"
     SCROLLFLAT="yes"
     SELECTION="yes"
     SHOWINTASKBAR="yes"
     SINGLEINSTANCE="yes"
     SYSMENU="Yes"
     WINDOWSTATE="normal"
/>
<script language="VBScript">
Dim objShell
 
Sub Run(Name)
  Set objShell = CreateObject("WScript.Shell")
  objShell.Run Name
  On Error Resume Next
  Set objShell = Nothing 
End Sub
</script>
</head>
<body bgColor="black">
<!– Launch Notepad, for example –>
<font color="white" onClick="javascript:Run(‘file://c:/Windows/notepad.exe’);" style="cursor: hand;"><u>Notepad</u></font>
<br>
</body>
</html>
Advertisements
Categories: HTA
  1. No comments yet.
  1. October 14, 2010 at 4:08 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: