What is the difference between the “WSH” and “WScript” objects?
-
13-06-2021 - |
题
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.
不隶属于 StackOverflow