Wscript no script file specified
If an object registers itself as a single instance object for example, word. Basic object in Microsoft Word 7. GetObject is applicable to all com classes and is not limited by the language in which the object is created. Example: when the following code is executed, the application associated with the specified strpathname is started and the objects in the specified file are activated.
If the strpathname parameter is completely omitted, GetObject returns the currently active object of the specified type. If an object of the specified type does not exist, an error occurs.
Some applications allow certain parts of a file to be activated. To do this, you need to add an exclamation point! For information on how to create this string, see the documentation for the application that created the object. For example, in a drawing application, a diagram stored in a file may contain multiple layers. You can use the following code to activate a layer called schema. However, some files may support multiple object classes.
For example, a sheet may support three different types of objects: an application object, a drawing object, and a toolbar object, all of which are part of the same file. In the following example, segment is the name of a drawing application, and drawing is one of the object types it supports. Description: exit execution and return the specified error code.
Intrerrorcode optional. If this parameter is included, Wscript will return it as a process termination code. If intrerrorcode is omitted, Wscript returns zero 0 as the process termination code. Description: makes the script process inactive for the specified number of milliseconds, and then continues execution. Sleep inttime Parameter: object required. The length of time, in milliseconds, that the inttime script process is inactive.
Note: in the sleep state, the script will continue to execute the processed events. If the script engine times out or is interrupted, sleep will end immediately. Description: sends output to a dialog box or console.
Echo [arg1] [, arg2] [, ARG3] Parameter: object required. Arg1, arg2, ARG3… List of items displayed. Note: if the host is wscript. Each item will be separated by a space. Under cscript. If no item is provided, a blank line is displayed. All the contents of this file will be displayed. So, its function is the same as msgbox, but not as powerful as it is.
Description: connects an object event source to a function with a given prefix. Strobject is the name of the object to connect to. Prefix of the strprefix event function. Example: the following example instantiates an imaginary object and connects it to a script file. Is this page helpful? Please rate your experience Yes No.
Any additional feedback? Submit and view feedback for This product This page. View all page feedback. In this article. Specifies batch mode, which does not display alerts, scripting errors, or input prompts. Specifies the engine that is used to run the script. This lets you run scripts that use a custom file name extension. We have received your request and will respond promptly.
Log In. Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework. The Tek-Tips staff will check this out and take appropriate action. Click Here to join Tek-Tips and talk with other members! Already a Member? Join your peers on the Internet's largest technical computer professional community. It's easy to join and it's free.
0コメント