cscript和wscript之间的区别

cscript和wscript之间的区别Windows Script Host WSH has been part of Windows since Windows NT4 Windows Script Host provides architecture for building dynamic scripts that consist of a core object model scripting hosts and

大家好,我是讯享网,很高兴认识大家。

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines.

自Windows NT4以来, Windows脚本宿主(WSH)就已成为Windows的一部分。 Windows脚本宿主提供了用于构建包含核心对象模型,脚本宿主和脚本引擎的动态脚本的体系结构。

The key components of Windows Script Host are CSCript, WScript, WSH ActiveX Control and Scripting engines.

Windows脚本宿主的关键组件是CSCript,WScript,WSH ActiveX控件和脚本引擎。

WSH ActiveX Control:

WSH ActiveX控件:

An ActiveX control that provides the core object model for the scripting host. Scripting Engines

一个ActiveX控件 ,为脚本宿主提供核心对象模型。 脚本引擎

Scripting engines

脚本引擎

Scripting engines provide the core functions, objects, and methods for a particular scripting language. VBScript and JScript scripting  engines are installed by default on Windows.

脚本引擎提供了特定脚本语言的核心功能,对象和方法。 Windows上默认安装了VBScript和JScript脚本引擎。


讯享网

CSCript and WScript are executables for the scripting host that are used to run the scripts. CSCript and WScript are both interpreters to run VBScript (and other scripting languages like JScript) on the Windows platform.

CSCript和WScript是脚本宿主的可执行文件,用于运行脚本。 CSCript和WScript都是在Windows平台上运行VBScript(和其他脚本语言,如JScript)的解释器。

CSScript is for console applications and WScript is for Windows applications. The Kernel checks a flag in the executable to determine which 

CSScript用于控制台应用程序,WScript用于Windows应用程序。 内核检查可执行文件中的标志以确定哪个

When starting using CreateProcess, if it is a console application, the kernel will create a console window for it if the parent process doesn't have one, and attach the STDIN and STDOUT and STDERR to the console. If it is a Windows application, no console will be created and STDIN, STDOUT and STDERR will be closed by default.

当开始使用CreateProcess时,如果它是一个控制台应用程序,则如果父进程没有一个,则内核将为其创建一个控制台窗口,并将STDIN和STDOUT和STDERR附加到控制台。 如果它是Windows应用程序,则不会创建任何控制台,并且默认情况下将关闭STDIN,STDOUT和STDERR。

If you want your script to have a console window, use CSCRIPT.EXE. If you want it to NOT have a console window, use WSCRIPT.EXE.

如果您希望脚本具有控制台窗口,请使用CSCRIPT.EXE。 如果希望它没有控制台窗口,请使用WSCRIPT.EXE。

This also affects some behaviors, such as the WScript.Echo command. In a CSCRIPT.EXE this writes a line to the console window. In WSCRIPT.EXE it shows a messagebox.

这也会影响某些行为,例如WScript.Echo命令。 在CSCRIPT.EXE中,这会在控制台窗口中写入一行。 在WSCRIPT.EXE中,它显示一个消息框。

When using CScript.exe:

1.jpg
小讯
上一篇 2025-04-03 13:10
下一篇 2025-01-05 18:27

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/82884.html