JScript Encoder

Posted on 2004-11-03
Last Modified: 2012-06-22
Hey people.

I want to use the JScript Encoder to encode my scripts. Also, I want to know how to fullscreen the windows media player with JScript.NOTE: I have already tried the microsoft website and it didn't work in the command line or in the RUN dialog box! Regards.
Question by:varuncvarada
    LVL 17

    Expert Comment

    by:Wim ten Brink
    Encode scripts? That will never work since browsers and script engines won't decode those files.
    LVL 1

    Author Comment

    They do. An example would be MSN Video. It uses encoded scripts and it has the tag setup like this: <script type="text/JScript.Encode">

    It has really weird characters that protect it so that when it is modified, the weird characters are not on the keyboard to type, so the script will be totally changed. I want to use the same method but when I did the Microsoft way, it didn't work in the Run dialog box or Command Prompt. I want to how MSN Video was capable of doing that.
    LVL 17

    Expert Comment

    by:Wim ten Brink
    I think MSN Video just uses it's internal encoding routines. The encoding is built-in MSN Video but not in a lot of other tools that use scripting to execute tasks.
    Basically, if you want to store a script and keep it invisible for others, you could encrypt or encode it yourself, but then it's only usable in applications that know how to decode it again.

    I Googled a bit and found this link, though:

    And the script encoder is at:

    But this only works in a minority of products. People who use FireFox or other browsers, for example, can't do anything with it. And several virusscanners might actually block these scripts because they could possibly be unsafe. It might also require that your scripts are created in some specific XML-like way or just part of an ASP page. I tried the commandline tool with the file iisstart.asp that is installed by IIS and indeed, only the scripting parts were encoded. The tool works best from a command prompt, btw. But an encoded script file that hasn't been created in an XML/ASP style will not be recognized by the scripting engine as an encoded script file, thus it won't run.
    LVL 1

    Author Comment

    This helped me with the decoder, but when I tried the encoder, it said:

    Scripting Encoder Object <"Scripting.Encoder"> not found


    how do i fix this problem?Regards
    LVL 17

    Accepted Solution

    Weird. Then again, maybe there's something missing on your system. I've tried Google again for that error message you gave and found one page mentioning the error:
    It's not helpful, though... Apparantly he used the wrong filename or something silly...

    It could be that the encoder needs to be run once without any parameter so it registers itself as a COM object within your system...

    I assume you're familiar with this:

    Usage:   screnc [/?] [/s] [/f] [/xl] [/l ScriptLanguage] [/e DefaultExtension] <source> <destination>

    Encode embedded script.
    /? -    Help
    /s -    Silent: display no messages
    /f -    Force: allow file(s) overwrite (source == destination)
    /xl -   Exclude Language: does not add the language directive in asp files
    /l ScriptLanguage - Script Default Language: specify the default script language to be used when encoding
    /e DefaultExtension - Default Extension: override actual file extension. Control the encoder to be loaded.
    <source> The file to encode. It can have wildcard characters.
    <destination> The destination file. When <source> contains wildcard characters, <destination> is the directory where to place the encoded files; files will keep the same name. When <source> and <destination> are the same /f must be used.

            screnc test.html encode.html
                    encode test.html into encode.html
            screnc /f test.html
                    encode and override test.html
            screnc /e html test.txt test1.txt
                    treat text.txt as an html file, encode it into text1.txt
            screnc test.asp c:\myDir\test.asp
                    encode test.asp into c:\myDir\test.asp
            screnc *.asp c:\myDir
                    encode all the asp files in the current directory and place them in c:\myDir
            screnc -s -f *.sct
                    encode all the scriptlet files in the current directory and override them. No message is displayed
            screnc -e asp *.* c:\myDir
                    encode *all* the files in the current directory as asp files. Place these files in c:\myDir
            screnc -e asp -xl *.inc c:\myDir
                    encode all the files with .inc extension as asp files. Does not add the @LANGUAGE directive at the top of the file
            screnc -l vbscript test.html encode.html
                    encode test.html into encode.html. When a script tag with no language attribute is found, VBScript is assumed to be the default language. If -l is not specified, JScript is assumed for html and VBScript is the default for asp

    But try running the application once without any parameters, then run it again. I'm not sure it works but okay, it's a guess since Scripting.Encoded refers to a COM object that doesn't appear to be registered...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Android App Development

    This course will involve creating widgets, customize list view, grid view, spinners, etc. Creating applications using audio, video, and SQLite database. Ending with publication on Google Play.

    Suggested Solutions

    Title # Comments Views Activity
    TextBlock Stops Updating 2 48
    format the code in java 6 60
    changeXy challenge 13 40
    array11 challenge 16 40
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    A short article about problems I had with the new location API and permissions in Marshmallow
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now