Windows script host enable2/2/2023 ![]() You could then call the script from a batch file and use the ERRORLEVEL environment variable to deal with the return code in some way. ![]() You can also use Quit to have your script return an error code by using the following syntax: WScript.Quit Īn integer value that represents the error code you want to return ![]() You use the WScript object's Quit method to shut down the script. In the Windows-based host ( WScript.exe), the information displays in a dialog box in the command-line host ( CScript.exe), the information displays at the command prompt (much like the command-line ECHO utility). Here, Argument1, Argument2, and so on, are any number of text or numeric values that represent the information you want to display to the user. The WScript object method that you'll use most often is the Echo method, which displays text to the user. WScript also contains the powerful CreateObject and GetObject methods, which enable you to work with Automation-enabled applications. You use this object to get and set certain properties of the scripting host, as well as to access two other objects: WshArguments (the WScript object's Arguments property) and WshScriptEngine (accessed via the WScript object's GetScriptEngine method). ![]() ![]() The WScript object represents the Windows Script Host applications ( WScript.exe and CScript.exe). Learn More Buy Programming the WScript Object ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |