Because Windows Script Host is a native scripting environment for the Windows operating system, you can write a program in a scripting language such as VBScript or JScript and run it right in Windows, simply by double-clicking on your script file.
The process consists of a set of carefully orchestrated communications between the script and the operating system and involves Windows Script Host and a scripting engine as intermediaries. Working from the inside out, Windows Script Host is integrated into the operating system, where it acts as an interpreter between Windows and a scripting engine. The scripting engine acts as an interpreter between Windows Script Host and a script.
The job of Windows Script Host is to provide access to the scripting engine of a number of operating system objects, such as files, folders, the registry, and network items.
The job of the scripting engine is to provide you with a scripting language that you can use to access and manipulate the various operating system objects provided by Windows Script Host. In this context, an object is basically an operating system component that provides you with a collection of subroutines methods and variables properties for working with that object from within a scripting language. Keep this description in mind as we examine some of the objects more closely.
Windows Script Host provides you with access to a number of objects that you can use from within your script to access various components in the operating system. Since those scripting engines are built into Windows Script Host, however, use of the FileSystemObject is transparent. Method Echo Displays message boxes on the screen. Method Quit Exits the currently running script. Property ScriptFullName Returns the full path and name of the currently running script. Method RegWrite Creates a registry key or value.
Property Environment Returns the current environment variable. Property UserName Returns the names of users. CopyFile Copies a file from one location to another. GetFileName Returns a filename.
FileExists Tests if a file exists. OpenTextFile Opens a text file for reading or writing. Editor's Picks. The best programming languages to learn in Check for Log4j vulnerabilities with this simple-to-use script. TasksBoard is the kanban interface for Google Tasks you've been waiting for.
To run one of these examples, copy the code below into a new program file and run it. Depending on the version of Visual FoxPro that you are using, you may need to change the name and the path of the Visual FoxPro executable in Example 2.
For the shortcut to be created, valid parameters must be passed for all methods. No error appears if one of the parameters is incorrect. Skip to main content. This browser is no longer supported.
Download Microsoft Edge More info. Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback?
0コメント