How to open subfolders of a CD or a disk?

I want to create a compiled website on a CD; the .exe is in the root of the CD and this website needs to open subfolders of the CD in Windows Explorer. How can I do that?

This can be made without any problem, but you need to make some changes to your HTML code. The best would be to use an HEScript script function. This function would be invoked from your HTML code: it will open the subfolder you specify with a parameter.

Just follow these steps:

1) We create the HEScript function. Open your HTML Executable project and go to the Script Manager. Double-click the “UserMain” script to open the script editor.

2) Add this function code:

procedure OpenSubFolder(FolderName: String);

var

EbookPath, MyFolder: String;

begin

EbookPath := GetGlobalVar("HEPublicationPath", "");

MyFolder := EbookPath + FolderName + "  ";

OpenFile(MyFolder, "", SW_SHOWNORMAL);

End;

3) Click Save Script.

4) Edit the HTML page with the links that should open the subfolder. Just replace the links with the HTML code provided in the sample below.

For instance, you have this CD structure:

ROOT
Mycompiledwebsite.exe (the compiled .exe file)
– Folder1 (a subfolder)
– Folder2 (another subfolder)

If you want a link that opens “Folder1”, use this HTML code:

`<a href="hescript://UserMain.OpenSubFolder|Folder1">Open Folder 1</a>`

Just specify the name of the folder after the | character. Note that folders shouldn’t have spaces (or use the %20 character like for URLs).

Compile your project and that’s all.

Introduction to Scripting

Using the Script Manager

Script Function Reference


Copyright G.D.G. Software 2016. All rights reserved