Compile with extractable script

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Compile with extractable script

Post by JRL » Sat Aug 04, 2012 5:26 am

This program will compile an executable from which the original script code is extractable. The exact code used in the compile is the code that will be extracted so you no longer have the worry of losing your original code, it is always available by extraction from the executable. The code extraction requires a password so the embedded code is secure.

This program does not compile, it uses your compiler. If you do not have the Professional or Enterprise versions of Macro Scheduler you do not have the compiler and this program will not help you.

This program should work with every version of Macro Scheduler since version 9.2.0 (you must have the latest release of v9 which is 9.2.0). Since it is written in and uses code only available in release 13 an executable is provided for those people with older versions. At this time the program cannot compile included files, cannot compile to a console app and cannot compile an encrypted script.

The compile will alter your original script by adding the compile parameters line at the top just as the Macro Scheduler compile does. The script will have three more lines added at the top. Those three extra lines will contain the name, date and time of the script the moment it was compiled.


----------- To use Extract_Compile:

1) Download Extract_Compile.exe from
2) Run the program and follow your instincts. If you've ever compiled a script it should be easy, there are only a couple of additional boxes from the standard compile screen with the first field being, browse to and select your script. This has to be asked because the program is not aware of what script you want to compile. Macro Scheduler might know which script you are compiling. This program does not.

3) If you've compiled the script before, the previous compile settings will set the appropriate checkboxes.

4) Leave the compile location at default and the new executable will be created in the same folder as the chosen script.

5) Be sure to check the "Compile script into EXE with Retrieval via Password" box

6) Be sure to enter a password (case sensitive) or intensionally leave off the password, extract will still work. The following characters are not permitted in your password.
ASCII characters 0 through 31
(greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)
^ (caret)
% (percent)
- (hyphen)
+ (plus)

7) You can also choose the 'Append "Extractable" Identifier to File Name' check box. This is for making your Extractable scripts more easily identified.

8) When you have all of your selections as you want them pick "Ok" and the compile will begin.

9) When the compile is complete, you will find an executable in the same folder as your script. Your script will be updated with a compile information line as the first line of the script similar to the compile information line created during a standard compile.




----------- To extract the script from the executable:

1) Run the executable from a command line using the command line parameter /extract=password (or /extract= if you intensionally left off the password at compile).

2) One easy way to do this is by RIGHT clicking the executable and dragging it. When you drop it a menu will pop up from which you pick "Create shortcut here". Open the properties of the shortcut by RIGHT clicking the shortcut and selecting "Properties" from the menu.

3) At the very end of the "Target" field, after the closing quote mark, add a space or two then /extract=password where "password" is the password you entered when you compiled (remember the password is case sensitive).

4) Pick OK on the shortcut properties.

5) Run the shortcut and the original script will be extracted to the folder containing the executable.

6) Be sure to either delete the shortcut when you've finished your script extraction or at least remove the password from the shortcut so you don't accidentally give your password away.

This is a work in progress. I'll try to note when I have made a change.

August 4, 2012 - Added:
^ (caret)
% (percent)
- (hyphen)
+ (plus)
to the list of illegal password characters.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts