[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1378
  • Last Modified:

JScript Encoder

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.
  • 3
  • 2
1 Solution
Wim ten BrinkCommented:
Encode scripts? That will never work since browsers and script engines won't decode those files.
varuncvaradaAuthor Commented:
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.
Wim ten BrinkCommented:
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.
varuncvaradaAuthor Commented:
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
Wim ten BrinkCommented:
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: http://aspturf.com/message_listing.asp?ID=10139
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...

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now