Archive

Archive for the ‘HTA’ Category

Write a basic HTA

August 13, 2009 1 comment
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
%d bloggers like this: