Skip to content

Convert HTA applications into a single executable.

Notifications You must be signed in to change notification settings

NxRoot/hta-to-exe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTA-TO-EXE - GUI PACKER

This project provides a template to pack HTA applications into a single executable.

Requirements

How to Install

Exe Description Releases
Download the latest version Download



HTA Tutorials

The app folder exists for 5 seconds before it gets deleted.
To access a file that is packed inside the app you need to read it on the window.onload event.

Access File System

var fs = new ActiveXObject("Scripting.FileSystemObject");

Get App Folder

var tmpFolder = fs.GetParentFolderName(window.location.pathname);

Get Exe Folder

var exeFolder = window.location.href.split("?path=")[1];

Read File

var fileContent = "";
var filePath = tmpFolder + "\\file_packed_inside_app.json";

if (fs.FileExists(filePath)) {
  var file = fs.OpenTextFile(filePath, 1);
  fileContent = JSON.parse(file.ReadAll());
  file.Close();
}

Write File

var data = { message: "Hello World!" }
var file = fs.CreateTextFile(exeFolder + "\\config.json", true);
file.Write(JSON.stringify(data, null, 4));
file.Close();

Access Shell System

var shell = new ActiveXObject("WScript.Shell");

Run Shell Commands

shell.Run("cmd.exe /C start tree", 1, true);

Folder Picker

var picker = new ActiveXObject("Shell.Application").BrowseForFolder(0, "Select a folder", 0);

if (picker){
  var folder = picker.Items().Item().Path;
  alert("Selected Folder: " + folder)
}

 

⭐ If you find this useful!

About

Convert HTA applications into a single executable.

Topics

Resources

Stars

Watchers

Forks