I understand that C:\Windows\System32\cscript.exe and its GUI version C:\Windows\System32\wscript.exe can interpret VBScript .vbs/.vbe (Microsoft Visual Basic Scripting Edition) and JScript .js (Microsoft's dialect of the ECMAScript/JavaScript) scripts. But I am not sure what Windows Script/Scripting Host .wsh, Windows Script File .wsf, and Windows Script Components .wsc files are. I would appreciate it if you could Eli5 to me what they are, maybe providing some examples.
- 892
- 4
- 19
- 54
1 Answers
A .wsh file is a "Windows Script Host control file":
Text document that contains properties and parameters for a certain script, i.e. a .VB or .VBS file; used for customizing the execution of certain scripts; requires WScript or CScript to run, both of which are included with the Windows operating system.
Windows Scripting Host however has 2 types of files as stated here:
There are two basic types of WSH scripts: standalone (i.e., language-specific) scripts and .wsf (Windows script file) scripts. Standalone scripts have a language-specific file extension—for example, .vbs ( VBScript) or .js (JScript). In contrast, .wsf scripts are language-neutral XML text files, and they provide some features beyond what standalone scripts provide.
This page tries to give a bit more context and examples:
Both follow an XML format that wraps the script code. The XML tags are interpreted by C/WScript, and direct it to the correct scripting engine to process the code inside. The file type .wsf is used to define scripts that are executed as commands.
while
The file type .wsc is used to define scripts that are treated as COM objects. The XML tags here denote the properties, methods, and events of the COM object, as well as the correct engine to invoke for scripts.
I leave those more knowledgeable to provide examples.
- 20,570