top of page
Search

Windows Script Host 5.6: The Latest Release of the Script Host for 32-bit Windows Systems

simonerichardson5


indows Script Host (WSH) version 5.6 is the latest release of the script host for 32-bit Windows systems. As a native component of Microsoft Windows XP and the upcoming Windows Server 2003, WSH 5.6 provides the environment for creating and hosting scripts that can perform both local and remote system administration tasks. WSH 5.6 also runs on Windows 2000, Windows Me, Windows 98, and Windows NT 4.0. If you're using one of these older systems, an add-on version of WSH 5.6 can be downloaded from the scripting section of the MSDN Web site at Although WSH comes with a rather compact object model to facilitate typical Windows administrative tasks, it provides nearly complete access to any imaginable task in Windows through script. WSH allows you to run scripts that use Windows Management Instrumentation (WMI) and Active Directory Services Interface (ADSI) functions. In addition, it provides programmable objects representing the system shell, the system registry, and the file system, in addition to an infrastructure to control remote scripts and secure your local system against malicious programs. WSH is definitely evolving to integrate with .NET, but full integration is still a little way off. In this article I'll describe the new features in WSH 5.6. You'll also see how .NET and scripting work together. In particular, I'll explore some of the techniques you need to set up WSH scripts that call into components based on the .NET Framework. Finally, the sidebar "The Road to Scripting in .NET" illustrates a component that compiles and executes C# code on the fly in much the same way as WSH does with VBScript and JScript sources.




Windows Script Host 5.6 Download




In particular, the tags in the WSF schema let you include external files and import constants from type libraries. The XML format is also the key to running different languages in the same script. WSH, in fact, has the ability to host multiple scripting languages and also supports calls from one language to functions written in another language. WSH 5.6 expands the types of metadata you can associate with a script. New tags have been introduced to create usage information and to define command-line argu- ments. One consequence of this improvement is that WSF scripts running under the control of WSH 5.6 don't need to use any kind of boilerplate code to detect the /? switch on the command line for the correct way to execute the script. The WSH 5.6 object model has a new method called ShowUsage, which can be called programmatically to show a pop-up window describing the usage of the script. This method is automatically invoked by the WSH runtime when the script has the /? switch. All the rest happens automatically, thanks to the WSH 5.6 runtime. I'll discuss ShowUsage and other benefits of metadata later.


Verifying a script is the process that determines whether the script that you are about to run is coming from a trusted source. Prior to WSH 5.6, you used the signcode.exe tool to encrypt script files. This tool is not strictly part of any version of the Microsoft Windows operating system. Rather it is part of the Microsoft Windows 2000 Platform SDK and is a separate download. The WSH 5.6 object model ships with a new object called Scripting.Signer that does the same thing. The following simple script signs a file using the specified certificate and store:


The WSH core (wscript.exe) is a relatively simple Win32 application that hosts the Windows Script engines and acts a kind of super proxy between the .vbs or .js user file and the script engine. In the past, a lot of people applied the same model to their applications making them customizable and extensible. The question you may be asking now is what's going to change in this area with the advent of .NET? Scripting has very little to do with .NET for two good reasons. First and foremost, WSH relies completely on COM. Second, the advantages you get from .NET languages over scripting languages are substantial in terms of performance and programming ease. Whenever you can use a .NET language instead, there's no question about what's better. The .NET Framework comes with a set of language engines that applications can host in much the same way as the VBScript and the JScript engines. These new engines are freely redistributable along with the rest of the framework. At this time, the two script engines that the .NET Framework provides run Visual Basic .NET and JScript .NET. In addition, a third engine is in the works for the .NET intermediate language (IL). This engine would be able to load precompiled IL code but not compile from sources. This new Script for the .NET Framework infrastructure has a number of advantages over the Windows Script engines. First, you have full access to the entire .NET platform. In other words, you are no longer forced to build a tailor-made object model in your applications just to allow for scripting. In .NET, the application is inherently programmable in the sense that any constituent public class is accessible without intermediate proxies. However, you can control what objects are effectively reachable via script and you can make the scripts run in a kind of secured sandbox. The languages you use to script .NET applications are the same first-class languages you use for writing them. They provide advanced features such as strong typing, early binding, and, of course, compiled code. In addition, Script for the .NET Framework can rely on the debugging and editing features of Visual Studio for Applications (VSA). To start using a language engine, you first create an instance of it, add some code, and then add the object model that the script is based upon. Objects are not attached to the engine through living instances as they were with the Windows Script engine. Instead, you need to specify the type and name in order to script the object. Only when the script executes and an instance of that object is needed will the engine call you back to obtain a usable instance for that kind of object. The interface involved with the setup of the engine is IVsaEngine. The interface for callbacks is IVsaSite. The language engines also support the ability to add references to .NET classes by creating an item in the engine with the full name of the involved assembly. In this way, all the types in the assembly are available to the script. When WSH is updated for .NET it is expected to be an application based on the Script for the .NET Framework engine and the new object model is heavily based on the VSA engine. What you can expect in the future of WSH, far beyond today's upgrade, is a shell-level environment that knows how to work with any .NET language from JScript .NET to Visual Basic .NET, and from J# to C#. Any of these languages will become just another "script" language supported by WSH. Why then would you use WSH instead of regular Windows Forms applications? Windows Forms are, and will be, full-fledged applications distributed through compiled code. It is expected that WSH applications for .NET will be script-like applications distributed through source code that will be compiled on the fly. Each of them will have its own use and gain its own space. For more information about Visual Studio for Applications see Information about Script for the .NET Framework can be found at Particularly helpful for understanding the big picture and getting started with some sample code are the articles in the Scripting Clinic column on MSDN Online.


WSH is a language-independent scripting host for 32-bit Windows platforms. Microsoft provides both Microsoft Visual Basic Script and Java Script scripting engines with WSH. It serves as a controller of ActiveX scripting engines, just as Microsoft Internet Explorer does. Because the scripting host is not a full Internet browser, it has a smaller memory footprint than Internet Explorer; therefore, WSH is appropriate for performing simple, quick tasks. Scripts can be run directly from the desktop by double-clicking a script file, or from a command prompt.


WSH is a language-independent scripting host for 32-bit Windows platforms. Microsoft provides both Microsoft Visual Basic Script and Java Script scripting engines with WSH. It serves as a controller of ActiveX scripting engines, just as Microsoft Internet Explorer does.


CScript.exe / wscript.exe Run a Windows Scripting Host (WSH) script. WSH provides a windows scripting environment with commands that are identical across Win 95 - NT - XP. WSH is available under Windows 95, and NT4 if Internet Explorer 4 (or above) has been installed. WSH is installed by default on Windows 98, Windows Millenium, Windows 2000 and XP. You can also download WSH. A silent install of WSH is possible using the command /q:a /r:n however it *must* be installed with Administrator rights (and the reboot must also be done under an admin account). The download of WSH version 5.6 (as shipped with XP) fixes a few bugs and adds to the features available in earlier releases.


The latest version of WSH is v5.8 which is included in Windows 7 computers. Other editions of Windows have version 5.7 or 5.6. Since version 5.6, a WSH can be digitally signed with a valid certificate.A website that uses scripting can automatically load or run what the script is programmed to do, but Microsoft added security enhancements for Internet Explorer 4.0 and higher to treat WSH objects as unsafe ActiveX controls. End-users will see a dialogue box or warning within the browser if they want to continue running the script from the webpage they are visiting or viewing.if(typeof ez_ad_units!='undefined')ez_ad_units.push([[300,250],'brighthub_com-large-mobile-banner-2','ezslot_15',148,'0','0']);__ez_fad_position('div-gpt-ad-brighthub_com-large-mobile-banner-2-0');If you come across an error that is related to Windows Script Hosting, check out the solutions in the next sections of this article.Common ErrorsNot all types of script host errors are related to malware or virus infection on a computer. There are programs that require running a script but if the permission of the user account in Windows is limited or restricted, an error message will be displayed saying that it could not run the script. In some cases, if the computer has been configured to run a script file that does not exist anymore, a WSH error message will be displayed saying the system cannot locate the resource specified. 2ff7e9595c


0 views0 comments

Recent Posts

See All

Download do whatsapp business numero fisso

WhatsApp Business com número fixo: como baixar e usar O WhatsApp é um dos aplicativos de mensagens mais populares do mundo, com mais de 2...

Comments


bottom of page