The FolderItem object represents an item in a Shell folder. Its properties enable you to retrieve information about the item. You can use the methods exposed by this object to run an item's verbs, or to retrieve information about an item's FolderItemVerbs object.
The FolderItems object represents a collection of items in a Shell folder. Its methods and properties enable you to retrieve information about the collection. The following Visual Basic example shows the relationship between several of the folder objects and how they can be used together. When the user chooses a folder, the folder's path is displayed in the text box called txtPath.
In VBScript, this function is slightly different because the ShellSpecialFolderConstants enumeration values are not available in script. The following example shows the VBScript equivalent of the previous example. In the following JScript example, which is a direct translation of the preceding VBScript example, note how the empty parentheses ' ' are used to invoke the Items and Item methods.
Each command is represented by a verb string. The set of supported verbs varies from file to file. The most commonly supported verb is "open", which is also usually the default verb. Other verbs might be supported by only certain types of files. The following examples show the use of ShellExecute to open Notepad. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. The ExpandEnvironmentStrings method expands the environment variables in a string and returns the resulting string.
LogEvent intType, strMessage [,strTarget]. The RegDelete method removes a registry entry based on strName. The RegRead method reads and returns a registry entry based on strName. RegWrite strName, varValue [,strType]. The RegWrite method writes a new entry into the registry. SendKeys strKeyString. Now we will take a look at some of the choices you have in scripting languages and platforms. You can think of a scripting platform as an environment in which a script can run.
Given that a script is nothing more than a collection of text, there has to be some means for the computer on which the script is running to understand that text and carry out its instructions. Shell scripting A shell is nothing more than an interface that allows a user to communicate with, or issue commands directly to, the operating system.
The concept of a shell has been around in UNIX for many years. In fact, there are several shells in the UNIX world, each with its own features and commands that make it suitable for various tasks. In Windows, there is no such diversity. You have only one shell, the Windows shell, which is built into the operating system.
Probably the easiest way to run it is to simply click Start Run, type cmd in the text box, and click OK, or create a shortcut to Cmd. The Windows shell comes with a set of built-in commands, many of which are well known and commonly used, such as dir, copy, del, cd, etc. Commands and their associated parameters are usually issued one at a time at the command line. More important for our purposes is the fact that commands can also be used in a batch mode.
That is, using a text editor, you can write a separate command on each line, saving the finished product with the extension of either. This turns the text file into an executable that will be run as an interpreted program, carrying out each command one line at a time, in order.
This is what we call shell scripting.
0コメント