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
6
votes
2 answers

How to pass an argument that starts with "//" to a wsh script?

If I have the following script (that just prints the first argument to the console): @if (@X)==(@Y) @end /* JScript comment @echo off cscript //E:JScript //nologo "%~f0" %* exit /b %errorlevel% @if (@X)==(@Y) @end JScript comment…
npocmaka
  • 55,367
  • 18
  • 148
  • 187
6
votes
1 answer

Microsoft Cursor Engine error '80040e21' Multiple-step operation generated errors. Check each status value

I am having a look on an old web application written in the 90s in VB6 and Active Server Pages (JScript). The application retrieves some data from the database and stores it in a recordset which it is using to update. When it attempts to update a…
Midas
  • 564
  • 6
  • 21
6
votes
1 answer

ClientPeoplePicker in CustomForm

I have Calendar and have a few customer fields and taking the input through a custom form. As the custom form defaults to using SharePoint:FormField for people picker; I have included the ClientPeoplePicker using the following…
Vishwa
  • 106
  • 1
  • 8
6
votes
1 answer

How do I control my computer master volume by batch file?

I have the following batch code. However, this code only turns up my PC volume, but I want to also turn down my volume. How can I achieve this? @if (@a==@b) @end /* :: Batch portion @echo off cscript /e:jscript "%~f0" :: JScript portion */ var…
Asif webs
  • 63
  • 1
  • 1
  • 3
6
votes
3 answers

Issues running JScript or VBScript files with UTF-8 encoding thru Windows Script Host

I'm not sure if I'm doing something wrong, but I can't seem to run the following JScript through the Windows Script Host if I save it in a .js file with the UTF-8 encoding: var name = "Hello world!"; WScript.echo(name); When I run it, it gives me…
c00000fd
  • 20,994
  • 29
  • 177
  • 400
6
votes
7 answers

Which to choose on Windows: VBScript, JScript, Wscript

I need to write some scripts for WinXP to support some of the analysts here at Big Financial Corp. I need to decide which type of Windows scripting best fits my needs. My needs seem pretty simple (to me anyway) run on WinXP Pro SP2 (version…
Sukotto
  • 2,472
  • 6
  • 26
  • 31
6
votes
1 answer

Parsing a JSON object array in Excel VBA

I know a similar question has been asked and answered before a few times: Parsing JSON in Excel VBA, Excel VBA: Parsed JSON Object Loop However, the above solution doesn't work if I am trying to access an array within the returned object. I'm…
user2062989
  • 61
  • 1
  • 1
  • 2
6
votes
2 answers

How to know valid script engine names for CScript.exe's //E:engine option?

When you execute a file with .VBS, .JS or .WSF extensions via CScript.exe, they execute correctly: CScript vbsProg.vbs CScript jsProg.js CScript wshScript.wsf However, we may use //E:engine option to run VBS or JScript files with different…
Aacini
  • 65,180
  • 12
  • 72
  • 108
6
votes
3 answers

Why WScript.StdOut.Write method behaves differently in VBS vs. JScript?

I have two small programs in VBS and JScript: VBScript.vbs: For i=0 To 255 WScript.StdOut.Write Chr(i) Next JScript.js: for ( var i=0; i <= 255; ++i ) WScript.StdOut.Write(String.fromCharCode(i)); When I execute they in the command-prompt,…
Aacini
  • 65,180
  • 12
  • 72
  • 108
6
votes
1 answer

Runtime error: Object expected not working inside of an if statement

When I remove the outside if statement, addmessage will create a link that will jump to the txtBillTxtSetSrc field when clicked. Inside of the if statement the link displays Microsoft JScript runtime error: Object expected". It works without the…
5
votes
1 answer

How can I package an "external" text file into an elisp module?

I'm writing an elisp module that requires an external text file. For the curious, the module integrates the interactive JS REPL for Cscript.exe with shell mode in emacs. It allows me to run an interactive javascript shell in emacs, on Windows. This…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
5
votes
2 answers

Get line number of an error in JScript run in Windows Script Host

Say, I have the following code that I run as a .JS file using the Windows Script Host: try { ProduceAnError(); } catch(e) { //How to get an error line here? } Is there any way to know the error line where an error (exception) occurred?
ahmd0
  • 16,633
  • 33
  • 137
  • 233
5
votes
1 answer

Using server-side javascript in classic asp: what's wrong with "this"?

similar: Inserting objects into global scope in classic ASP / Javascript Trying to get started with using javascript in classic ASP. Seem to be some "gotchas" with this though: can anyone with some experience in this tell me what's up with the…
Tim Williams
  • 154,628
  • 8
  • 97
  • 125
5
votes
4 answers

Windows Script Host (jscript): how do i download a binary file?

i'm trying to automate a file download with Windows Script Host (JScript). i see ADODB.Stream has an Open method whose documentation makes it seem like it should be possible to open a HTTP URL and stream the response body: var url =…
just somebody
  • 18,602
  • 6
  • 51
  • 60
5
votes
1 answer

Running Batch file from JScript in HTA

I'm creating this HTA app with JScript that writes a BAT file and opens it in cmd afterwards. If I manually open the created BAT file from windows it works like it should. When I open it through my HTA, the file opens but only outputs Echo and…
Jon
  • 85
  • 7
1 2
3
78 79