What is the difference between the WSH and WScript objects?

this.wsf:

<?xml version="1.0" encoding="utf-8"?>
<package>
    <job id="this">
        <?job error="true" debug="true"?>
        <script>
            this;
            debugger;
        </script>
    </job>
</package>

Double click on the WSF file, or execute this command to debug with Visual Studio:

wscript /d /x this.wsf

In Visual Studio, when you hover over this, you see two objects: WSH and WScript.

Which should be used?

有帮助吗?

解决方案

They are the same object, so it doesn't matter which one you use, but all the examples use WScript.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top