Version: | 3.0.3.9 |
Table Of Contents
- Command Line Operation
- Legacy Parameters
- Advanced Parameters
- Report File Layout
- Supported File Encodings
- Supported Code Pages
- Deprecated Command Line Parameters
- Examples of Using Command Line Parameters
- User feedback
[Click here to view the main manual]
Command Line Operation
Script Encoder Plus can run from the Windows command line without involving its graphic user interface (or GUI.) You can also use command line parameters to perform batch conversions of multiple scripts at once.
Specially designed ScrEnc.exe module, that is available in the main download package, can be used for a true command line experience:
To evoke Script Encoder Plus from command line run it using the following syntax:
SCRENC [Parameters]
Legacy Parameters
The following legacy parameters are supported:
/run [/s] [/f] [/xl] [/l defLanguage] [/e defExtension] inputfile outputfile
NOTE: Default values for parameters from the description below will be used if none are specified.
-
/?
Show help window.
-
/run
Must be specified to use any of these command line parameters.
INFO: This parameter can be omitted if command line call is done via the screnc.exe module. It is required only when command line parameters are invoked via the screncgui.exe module.
-
/s
Do silent conversion, or don't show status window (Default is not to be silent).
INFO: Keep in mind that conversion of multiple files may take a longer time.
-
/f
Force overwrite input file(s).
If <outputfile> is not used, <inputfile> will be used as output.
Default is not to overwrite files.
WARNING: This option will make Script Encoder Plus overwrite the source file(s) specified by the <inputfile> parameter without a prompt!
This option cannot be used along with the /isf parameter for safety reasons. -
/xl
[Deprecated] This flag is not used. The @language directive is added only when needed.
-
/l ScriptLanguage
Default language to be used if none were specified in an HTML/ASP file. (Example: <ScriptLanguage> could be "VBScript", "JScript".)
Default: None -
/l=ScriptLanguage
Same as the /l parameter described above.
-
/e DefaultExtension
Associate input file(s) with a specific file type.
<DefaultExtension> could be: asa, asp, htm, js, vbs
Default: None
Do not specify this parameter if you want the script type to be determined automatically by the input file(s) extensions.
(This parameter overrides the /tp parameter.) -
/e=DefaultExtension
Same as the /e parameter described above.
-
<inputfile>
The file(s) to convert. This parameter is mandatory and must specify files only.
- It can contain a relative, absolute or a network path.
- If file name/path contains spaces, enclose it into double-quotation marks. (Example: "My file.htm")
- To specify more than one file, separate them with the | symbol. (Example: "file1.js|file2.htm")
- It doesn't matter in what order you place this parameter, except that it has to be the first non-flag one. Make sure that this parameter doesn't follow any of the legacy flags: /l or /e.
- The file name(s) may contain the following wildcards:
- * - for any match (Example: "*.js" will match all files with the JS extension)
- ? - for a single character match (Example: "file.htm?" will match files such as "file.htm" and "file.html")
-
<outputfile>
The destination location.
- This parameter is mandatory if /f is not specified.
- It can contain a relative, absolute or a network path.
- When <inputfile> specifies more than a single file (by using the | symbol, or by containing wildcards) <outputfile> is interpreted as a folder, and all converted files will be placed into it and will retain their names.
- If this name/path contains spaces, enclose it into double-quotation marks. (Example: "My folder")
- If it specifies a folder and it doesn't exist the /cf parameter must be used to create it automatically.
- If <outputfile> refers to the same location as <inputfile> the /f parameter must be used. In this case the /isf parameter cannot be used for safety reasons.
- It doesn't matter in what order you place this parameter, except that it has to be the second non-flag one. Make sure that this parameter doesn't follow any of the legacy flags: /l or /e.
Advanced Parameters
The following advanced parameters are supported:
[/op=[s|o|n|rc]] [/tp=[h|a|j|c|m|v]] [/lf=[c|l|r]] [/htm=[g[t[m[o[c[s[u[x[a]]]]]]]]]] [/sct=[e[q[c[m[a[r[u[j[k]]]]]]]]]] [/isf] [/cf] [/xtr=[a]] [/ret=N] [/awse=[all|server|[ScriptType1[,ScriptType2][,...]]]] [/xle] [/fe=[ANSI|utf-8|utf-16be|[utf-16|Unicode]]] [/cp="Name"] [/rpt[="Path"]] [/uid=ID] [/r="RegistrationName" /c="RegistrationCode"] [/deauth]
NOTE: Default values for parameters from the description below will be used if none are specified.
/op | Operation to perform.
Accepted one of the following values: s for scramble, o for organize; n for no change; rc for remove C++/JScript/VBScript comments only. |
/tp | Type of the <inputfile>.
Accepted one of the following values: h for HTML; a for classic ASP; j for JavaScript; c for C/C++; m for MFC/C++; v for VBScript |
/lf | Type of end-lines to use for saving.
Accepted one of the following values: c for Carriage Return & Line Feed; l for Line Feed; r for Carriage Return |
/htm | Individual flags for the HTML/ASP files:
There are several types of equation signs that you can use for this parameter:
Use any combination of the following flags:
|
/sct | Individual flags for the JavaScript/JScript/VBScript files or script blocks within HTML/ASP files:
There are several types of equation signs that you can use for this parameter:
Use any combination of the following flags:
|
/isf | If wildcards were used in the <inputfile>, to include all subfolders in the search as well. (Default: Off)
(This parameter cannot be used along with the /f parameter.) |
/cf | If <outputfile> specifies a folder, this option creates it first before writing converted files into it. (Default: Off)
(The folder is created with all the subfolders specified in the <outputfile> path.) |
/xtr | Additional/extra flags:
There are several types of equation signs that you can use for this parameter:
Use any combination of the following flags:
|
/ret | Value for the random escaping/capping threshold. Allowed values are from 1 to 15, inclusive.
[1=Less, ... 15=More] |
/awse | Allow applying Windows Script Encoder method in HTML/ASP files to:
|
/xle | The @language directive will not be added to classic ASP files if Windows Script Encoder method was used (Default: Off)
IMPORTANT: If you use this flag, make sure to add the @language directive manually afterwards. |
/fe | File encoding to be used for saving <outputfile>:
|
/cp | Abbreviated code page name to be used for conversion while saving <outputfile>:
|
/rpt | Generate conversion report: (Default: Off)
|
/uid | User ID to be added to the report file (if /rpt parameter was used.) (Default: "")
If ID value contains spaces, enclose it into double-quotation marks. (Example: "ID #123") |
/r, /c |
Performs a one-time registration of this copy of the Script Encoder Plus for the Windows user account that it was run under. /r parameter specifies the registration name for the license, and /c parameter - the registration code. Note that depending on the type of the Script Encoder Plus license, it may allow you to run the program only on a single Windows user account.
INFO: It is not necessary to include these parameters if the Script Encoder Plus is already registered. INFO: When running Script Encoder Plus on the ASP/IIS/Windows server make sure to obtain and register the appropriate number of development licenses. Keep in mind that the afore-mentioned servers may run the Script Encoder Plus from under several different Windows user accounts, each of which requires a separate registration. |
/deauth | Removes registration license from this copy of the Script Encoder Plus for the Windows user account that it was run under.
INFO: Deauthorize your copy of the Script Encoder Plus only if you're moving it to another computer or to a different Windows user account. INFO: When running Script Encoder Plus on the ASP/IIS/Windows server make sure to obtain and register the appropriate number of development licenses. Keep in mind that the afore-mentioned servers may run the Script Encoder Plus from under several different Windows user accounts, each of which requires a separate registration. |
Additional Information
NOTE 1: Spaces serve as separators between parameters in the command line. In case you need to include spaces in a parameter's value, enclose it into double-quotation marks:
Example: /uid="File 1"
NOTE 2: In case you need to include special characters in a parameter's value, escape them with the '\' symbol:
Example: /uid="\"a\"\\b", will set UID to "a"\b
IMPORTANT: In case of specifying a folder, make sure not to include the last slash:
Example: "C:\My folder\" will treat the last slash as an escape sequence for the double-quote.
Use "C:\My folder", or "C:\My folder\\" instead.NOTE 3: It is not recommended to use command lines longer than 256 symbols (including the path for the "screnc" itself).
To specify a longer command line save it in a text file and use the following syntax to run it:
(When used with the '::' or '*::' syntax, no other command line parameters should be used when calling "screnc".)Examples:
-
screnc ::"Path"
Will read the command line from a file specified by "Path"
Example: screnc ::"external commands.txt"
The format of the external command line is the same as described here, except that line breaks are interpreted as spaces.
-
screnc *::"Path"
Will read the command line from a file specified by "Path" and delete that file when done.
Example: screnc *::"temp external commands.txt")
The format of the external command line is the same as described above, except that the line breaks are interpreted as spaces.
-
Report File Layout
- This report is generated only if /rpt parameter was used.
- If this data is saved in a file, the ANSI format is used.
- Each value is presented on a separate line.
- Empty lines, or lines starting with the equation sign '=' should not be interpreted.
The following is line-by-line format of the report file:
ID: "[Value]"; | ID Value specified in the /uid parameter. |
TIMESTAMP: <Time> | Time stamp when the conversion began. Format: YYYYMMDDHHmmSS, where YYYY=4-digit year, MM=2-digit month, DD=2-digit day, HH=2-digit hour (in 24-hour format), mm=2-digit minutes, SS=2-digit seconds. |
CMD_LINE: <CmdLine> | Full set of command line parameters used for the conversion. |
VER: "<Version>" | Version of the Script Encoder Plus this report was generated by. |
Collecting Files: | |
FOUND: <Number> | Total number of files found suitable for conversion. (Note that the number of files converted can be less than this number.) |
Starting Conversion: | Delimits the beginning of the conversion process. |
SRC: "<source>" | Source file used for conversion. |
DEST: "<destination>" | Location where the destination file was placed after conversion. |
STAT: 0x<Code> | Result code generated after converting the file above: The code value is presented as a hexadecimal number, preceded by '0x':
Or the following error codes:
|
TYPE: <Type> | Type of the script used for conversion.
Could be: HTML, ASP, JavaScript, C, C++, VBScript, or <empty> |
OP: <Type> | Type of the operation performed during conversion.
Could be: "Scramble", "Organize", "Remove Comments", "No Change" |
FECP SRC: "<Value>" | File encoding and code page of the source file before conversion.
Format: "<FileEncoding>/[<ShortCodePageName>] <LongCodePageName>", |
FECP DEST: "<Value>" | File encoding and code page used for saving converted file. See 'FECP SRC:' above for format details. |
ENC: <Value> | Specifies whether Windows Script Encoder method was used on this file, or in case of HTML/ASP file, if it was used on any of the <script> blocks in them. Could be: Yes or No. |
SC_ADD: <Number> | Number of semicolons (or colons) added to the script.
(For HTML/ASP file this is a total number for all script blocks.) |
SC_RMD: <Number> | Number of semicolons removed from the script.
(For HTML/ASP file this is a total number for all script blocks.) |
RESULT MSG: | |
<Message> | Human readable message signifying the result of conversion.
|
After the last converted file: | |
Operation(s) Results: | Delimits the end of the conversion process. |
CONV_OK: <Number> | Number of files converted successfully. |
ERRORS: <Number> | Number of errors that occurred during conversion.
(Errors normally mean that conversion was aborted for that number of files.) |
WARNINGS: <Number> | Number of warnings that were issued during conversion.
(Warnings normally mean that converted data was saved, but with some unforeseen adjustments.) |
SYNTAX ERRS: <Number> | Number of files that contained syntax errors in the JavaScript/JScript blocks/files.
(This may mean that conversion produced some erroneous results due to encoder's inability to interpret scripts correctly.) |
RESULT CODE: 0x<Code> | Overall result code for the conversion process:
This value should be evaluated along with result codes for each converted file if appropriate bits are set for the positive result codes (see below). This value will be returned from the screnc.exe module to a calling process. The code value is presented as a hexadecimal number, preceded by '0x'. In case of a positive value, only lower 16 bits are used for the code:
Bits 17 through 20 may be set individually in case of the following:
In case of a negative value, the whole value is used for the code:
|
Supported File Encodings
The following file encodings are recognized and supported by Script Encoder Plus:
ANSI | American National Standard Institute encoding using one byte per character. This is a default encoding. (Using this encoding for non-English pages may cause the loss of non-English characters) |
UTF-8 | Unicode Transformation Format-8 encoding using variable number of bytes per character - lossless encoding of Unicode characters. |
UTF-16 | Unicode Transformation Format-16 encoding using two bytes per character. |
UTF-16BE | Unicode Transformation Format-16 (big-endian) encoding using two reversed bytes per character. |
Supported Code Pages
Script Encoder Plus supports many code pages for the following languages. Here is the list of the currently supported code pages:
To get an up-to-date list of supported code pages go to Help -> Command Line Help in the Script Encoder Plus menu.
INFORMATION: Although Script Encoder Plus has support for many international code pages you might not be able to use all of them by default as some of them might not be installed on your system. To check code pages installed in your Operating System go to Control Panel, and then to Regional and Language Options.
Deprecated Command Line Parameters
Are no longer supported.
Examples of Using Command Line Parameters
The following are examples of using Script Encoder Plus via command line calls:
Encode "test.htm" into "encode.htm" using Windows Script Encoder method.
screnc /run test.htm encode.htm
Encode "test.html" using Windows Script Encoder method and overwrite it.
screnc /run /f test.htm
Treat "text.txt" as an HTML file, and encode it into "text1.txt" using Windows Script Encoder method.
screnc /run /e html test.txt test1.txt
Encode "test.asp" into "c:\myDir\test.asp" using Windows Script Encoder method.
screnc /run test.asp "c:\myDir\test.asp"
Encode all ASP files in the current folder using Windows Script Encoder method and place them into "C:\Users\John Doe\Documents\Test" folder.
screnc /run "*.asp" "C:\Users\John Doe\Documents\Test"
Scramble all JavaScript and VBScript files in the current folder with minimum scrambling options and overwrite them. No status window is displayed, and Windows Script Encoder method is not used.
screnc -run -s -f "*.js|*.vbs" /op=s /sct=""
(Available in Premium Version only) Organize ALL the files in the current folder as ASP files. Place them into "C:\Users\John Doe\Documents\Test" folder.
screnc -run -e asp *.* "C:\Users\John Doe\Documents\Test" /op=o
Encode all the files with .inc extension as ASP files. Do not add the @LANGUAGE directive at the top of each file. Place the results into "C:\Users\John Doe\Documents\Test" folder.
screnc -run -e asp -xl "*.inc" "C:\Users\John Doe\Documents\Test"
Encode "test.html" into "encode.html". When a script tag with no language attribute is found, VBScript is assumed to be the default language.
screnc -run -l vbscript test.html encode.html
Compact all HTML files in the current folder by scrambling them with minimum settings (only adding and removing of extra semicolons is required, do not escape non-ASCII characters). Save results with UTF-8 file encoding into "Compacted HTML" folder. Use only Line Feeds at the end of each line while saving files. Generate on-screen report.
screnc /run /op=s /lf=l /htm="" /sct=ar /xtr="" /fe=utf-8 /rpt "*.htm?" "Compacted HTML"
Scramble all the .htm files in the "C:\Users\John Doe\Documents" folder (including subfolders) and place the results into "C:\Users\John Doe\Documents\Test" folder. Use the following options: Escape HTML tags, escape HTML text, use random escaping, keep HTML comment tags, allow scrambling of URLs in the HTML, with the use of short escape sequences. Also escape quotes and code at random in the JavaScript blocks, add missing semicolons. Set the random escaping threshold to 6 (middle value). Encode the result using Windows Script Encoder method.
screnc /run /op=s /htm=gtmcux /sct=qcmae /ret=6 "C:\Users\John Doe\Documents\*.htm" "C:\Users\John Doe\Documents\Test" /isf
Rewrite each file with the .js, .jse, .vbs, .vbe, etc. extension in the current folder with the "Central European (Windows)" code page. Do not perform encoding with the Windows Script Encoder method. Generate on-screen report to see the results.
screnc /run /cp="windows-1250" /f "*.js?|*.vb?" /rpt /sct-=e
Encode all HTML, ASP and JavaScript files in the current folder and place the results into "Test" folder. Apply Windows Script Encoder method only to the HTML and ASP script blocks with the JavaScript, JavaScript1.2, or JavaScript1.3 language tag. Do the "all-inclusive conversion" to update all <script> tags within HTML and ASP pages if corresponding .JS file was encoded. Generate a report in the "C:\Users\John Doe\Documents\results.txt" file, and use ID equal to 1 in it.
screnc /run /op=s /awse="JavaScript, JavaScript1.2, JavaScript1.3" /htm=a /uid="1" /rpt="C:\Users\John Doe\Documents\results.txt" "*.htm?|*.asp|*.js" Test
Scramble all VBScript files in the current folder by doing random capping and adding end-line colons. Then encode the result using the Windows Script Encoder method. Create "c:\My folder\VB files\Encoded" folder and save resulting files into it after changing the file extensions to reflect the encoding.
screnc /run /op=s /tp=v /lf=c /sct=mau "*.vbs" "c:\My folder\VB files\Encoded" /cf
-
Scramble and encode the "test.htm" file in the current folder with the maximum scrambling options on and save it as "test_scrambled.htm" file:
screnc /run /op=s /htm+=gt /sct+=qcaru "test.htm" "test_scrambled.htm"
Remove comments from all JavaScript and VBScript files with .js and .vbs extensions from two folders (excluding their subfolders), place results into "C:\path-to\folder-to-receive-files" folder. Use Microsoft-specific Line Feed & Carriage Return at the end of each line
screnc /run /op=rc /lf=c "C:\path-to\folder-with-js-files\*.js|C:\path-to\folder-with-vbs-files\*.vbs" "C:\Path-to\folder-to-receive-files"
Remove comments from all JavaScript files with .js extension from a folder (excluding its subfolders), place results into "C:\path-to\folder-to-receive-files" folder. Use Linux-specific Line Feeds at the end of each line.
screnc /run /op=rc /lf=l "C:\path-to\folder-with-js-files\*.js" "C:\path-to\folder-to-receive-js-files"
Remove comments from all .c, .cpp, and .h files in the current folder (including all subfolders), treat these files as C++/MFC files and place results into "C:\Users\John Doe\Documents\Test C++" folder. Use Microsoft-specific Line Feed & Carriage Return at the end of each line.
screnc /run /op=rc /tp=m /lf=c /isf "*.c|*.cpp|*.h" "C:\Users\John Doe\Documents\Test C++"
-
(Available in Premium Version only.) Organize all HTML and ASP files in the "C:\My files" folder, make sure not to use comment tags on script blocks within them though. Include all subfolders as well, and place the results into the "C:\My files\Converted Files\Organized" folder (note that this folder must exist before the conversion).
screnc /run /op=o /htm-=s "C:\My files\*.htm?|C:\My files\*.asp" "C:\My files\Converted Files\Organized" /isf
Register your copy of the Script Encoder Plus for the Windows user account that this command was run under. Note that this command must be run only once from the Windows user account that you want to register the Script Encoder Plus for. Make sure to follow your registration license terms when registering.
screnc /r="John Doe" /c="ABC123-4567-CDEF-FFFF-EDCB"
INFO: Check the output to make sure that the registration was successful.
INFO: Registration name and code could be obtained from the main menu of the Script Encoder Plus, by going to Help -> Register.
INFO: The registration code above is given for demonstration purposes only and is not valid.
Thank you for using Script Encoder Plus!
Feel free to send us your bug reports and suggestions for improvement. Even though we can't answer every single email, we listen and appreciate your time writing us!
Support Team
www.dennisbabkin.com