Questions tagged [wsh]

For questions relating to Windows Script Host (WSH), a language-independent scripting host for the Windows operating system. It allows scripts to be run from both the graphical Windows desktop (via WScript.exe) and the command prompt (via CScript.exe).

Windows Script Host (sometimes abbreviated as WSH), in both Wscript.exe and Cscript.exe guises, can run VBScript (*.VBS, *.VBE) and JScript (*.JS, *.JSE), via Microsoft-provided script engines that are bundled with the OS and installed by default.

In addition to VBScript and JScript, there are third-party script engines for WSH that you can download to allow the use of Python, REXX, Perl, and other languages. (The script engines that add into WSH are distinct from standalone script interpreters that might exist for those languages, on Windows).

Multiple languages can be mixed in Windows Script Files (*.WSF). These types of scripts may also be used to link many other external scripts together using a src parameter on the <script> tag in a manner similar to HTML. A WSF makes reference to each script module in a very basic XML hierarchy and it's a package that can be organized in jobs.

Regardless of whether the UI is console-based or graphical, the same underlying script engine is used. In UI mode, the host is WScript.exe (used by default); in console mode, the host is CScript.exe.

The Windows Script Host has been part of every Microsoft Windows operating system's installation since Windows 98.

In 2006, Microsoft released v1.0 of Windows PowerShell, which could be conceived as a replacement for, or successor of, Windows Script Host. PowerShell is now included in every Windows OS. Even so, WSH is still included in every Windows OS, and many Wscript programs will continue to be in service, for many years.

References:

Related tags:

1060 questions
-2
votes
2 answers

Build algorithm without "if"

There are List and List When the new Client connect to Service(Server), a new client's name will be written to all clients who is in the session. But new client get only yourself. I have: foreach (IClientCallBack client in…
-2
votes
4 answers

JavaScript - how to build string with escape character?

I am writing JScript to be run using Windows Script Host. Say I have a simple string variable: s1 = '\n' I want to build s2 from two separated chars: \ & n. naively I would like to do: s2 = ''; s2 += '\\'; s2 += 'n'; But this of course lead to s1…
idanshmu
  • 4,621
  • 4
  • 39
  • 81
-3
votes
1 answer

How do you stop an out of control wscript command?

How do you stop an out of control wscript command? Do you press CTRL+C ? Is there a way to stop it?
leeand00
  • 23,306
  • 34
  • 125
  • 265
-3
votes
1 answer

VBScript keeps turning errors such as declaration expected on line 10 and others

I seem to be having some problems on line 10 there. There are probably other errors as well. I've run debug to try and isolate the problems, any help is greatly appreciated. Option Explicit On Dim fso Set FSO =…
-3
votes
1 answer

Find "www." in a string in javascript

I have to make a function that finds when "www." Appears in a string, for example "Hey dude, check this thing: www.example.com/". I want it to determine when the url starts(in this case it would be the 28th character in the string). I tried…
Maigol
  • 7
  • 4
-3
votes
1 answer

Can I have a COM interface in a service to be called from Windows Script Host?

My goal is to create a COM interface in my Windows local service, written with C++/MFC, whose methods could be called from a Windows Script Host JScript code running under a logged in interactive user account. For instance, if I have a test.js that…
c00000fd
  • 18,074
  • 19
  • 132
  • 318
-4
votes
1 answer

Run-time error '429': ActiveX component can't create object in VBA/VBS/WSH

I know it has been asked so many times, but I've gone through dozens of pages, with no luck, since mine seems to be a OS/machine related problem rather then of a specific library. Trying to manage ID3Tags, or in general, files extended properties,…
Cicca
  • 11
  • 1
  • 2
-4
votes
1 answer

jscript code to C#

Any good jscript code converter to C# I want to convert this piece of code into C# This code is for generating admin password base from device MAC Address