Questions tagged [jscript]

JScript is a scripting language based on the ECMAScript standard, created by Microsoft and implemented in a range of environments. You would expect this tag to accompany questions regarding these environments, such as Windows Script Host (WSH), Active Server Pages (ASP) and HTML Applications (HTA).

JScript is a scripting language based on the standard, created by Microsoft and implemented in a range of environments, including:

JScript is not to be confused with JavaScript () — although they are both implementations of the ECMAScript language — because, often, people refer to JScript when discussing client or server scripting outside of a web page. As such, you would expect the tag to accompany , or questions. was named after JScript, but it is not the same.

JScript supports several unique features such as conditional compilation, COM object instantiation and a method to force garbage collection.

Official Documentation

1180 questions
3
votes
1 answer

How to implement IObjectSafety programmatically in JScript.NET

tldr; How to mark a JScript.NET dll as safe for scripting? Consider this JScript.NET library (helloworld1.js): package helloworld1{ class test1 { public function test1run(){ return 'This is a string returned from helloworld1.dll'; } …
Tony
  • 1,811
  • 1
  • 20
  • 27
3
votes
4 answers

Is there a local runtime environment for running Javascript? (like Windows Scripting Host for JScript)

I wonder if there is a 'local runtime environment' for hosting Javascript code, that's not browser based, for running small local apps? Something like WSH (Windows Scripting Host) for JavaScript (not MS-JScript). I would like to run some javascript…
andora
  • 1,326
  • 1
  • 13
  • 23
3
votes
1 answer

Which one execute first?

Here is the code: Which one will execute first…
Derek 朕會功夫
  • 92,235
  • 44
  • 185
  • 247
3
votes
3 answers

in JavaScript, when finished with an object created via new ActiveXObject, do I need to set it to null?

In a Javascript program that runs within WSH and creates objects, let's say Scripting.FileSystemObject or any arbitrary COM object, do I need to set the variable to null when I'm finished with it? Eg, am I recommended to do this: var fso = new…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
3
votes
3 answers

Error "ASP 0115 a Trappable Error Has Occurred" after Microsoft patch CVE-2019-1367

Jscript Unexpected exceptions After Windows Server patch Vulnerability (CVE-2019-1367) released in 23. September Windows Server 2019 (KB4522015) https://support.microsoft.com/en-us/help/4522015/windows-10-update-kb4522015 Windows Server 2016…
Sandis
  • 31
  • 1
  • 4
3
votes
1 answer

MSXML2.ServerXMLHTTP clientcertificate

I'm using MSXML2.ServerXMLHTTP in JScript / VBA and want to set the client certificate path. In WinHTTP.WinHTTPRequest I could use the option '.setClientCertificate', but this seems absent in MSXML2.ServerXMLHTTP. Is there any argument I can use for…
JasperD
  • 152
  • 1
  • 3
  • 15
3
votes
2 answers

How to hide cmd.exe and cscript command prompts?

I have a test.cmd file on my desktop. In it contains the following line: cmd.exe /c "cscript foo.js" Is it possible to completely silence/quiet/supress/hide any and all console windows from popping up? I would like to execute the .cmd without any…
Nicole
  • 99
  • 3
  • 7
3
votes
1 answer

JScript regex - extract a substring between 2 words containing 1 or more occurrences of another word

I have a text extracted from a large PDF file. I am only interested in one part of this text. I only need the part which is present between 2 test substrings AND which has 1 or more occurrences of a specific word XX12QW. Out of those 2 test…
Gurmanjot Singh
  • 10,224
  • 2
  • 19
  • 43
3
votes
2 answers

Accessing a Variant/Object/JScriptTypeInfo property in VBA

I have the following code VBA code (for an Excel module) Function getDesc(ByVal pCode As String) As String Dim oRequest As Object Set oRequest = CreateObject("WinHttp.WinHttpRequest.5.1") oRequest.Open "GET",…
Display name
  • 1,109
  • 1
  • 15
  • 31
3
votes
2 answers

Save a file from Enterprise Architect Script

I'm tring to create a script thats shows a dialog where I can select a path to save a file. The following got it almost, but this is to open a file, not save it. var filePath = OpenCSVFileDialog(); var fileName = GetFilenameFromPath(filePath); …
byandreee
  • 57
  • 6
3
votes
2 answers

Is asynchronous call of JavaScript function possible in Windows Script Host?

Imagine you have a simple function in Windows Script Host (JScript) environment: function say(text) { WScript.Sleep(5000); WScript.Echo(text); } Is it possible to call say() asynchronously? Note: Such browser-based methods as setInterval()…
3
votes
0 answers

Backtracking lexer for ANTLR

I'm extending a JavaScript ANTLR grammar that uses the C target to handle JScript's conditional compilation comments, i.e. /*@cc_on ... @*/. These need to be handled separately from normal block comments since /*@cc_on /* hello */ @*/ results in a…
BruceBerry
  • 1,166
  • 1
  • 9
  • 21
3
votes
0 answers

Which version of JScript does cscript.exe use?

Which version of JScript does cscript.exe use? Does it match any version of Internet Explorer, e.g. IE6?
dimmoborgir
  • 189
  • 1
  • 9
3
votes
3 answers

Is there any reason to replace JavaScript with JScript in Internet Expolorer?

So when JScript is different from JavaScript, how does IE interpret jQuery, and all the other JavaScript-s ? Is it better to replace the JavaScript with JScript for IE? Are there any performance diferences?
Bakudan
  • 19,134
  • 9
  • 53
  • 73
3
votes
1 answer

JScript: identifying whether double quotes are passed to a WSH script

There are situations when it is important to identify whether double quotes are passed as arguments to a WSH script. For example because they should be passed to another executable to be run. The standard parsing functions/objects: objArgs =…
antonio
  • 10,629
  • 13
  • 68
  • 136