zoukankan      html  css  js  c++  java
  • Windows Script Files (.wsf)

    A Windows script (*.wsf) file is a text document containing Extensible Markup Language (XML) code. It incorporates several features that offer you increased scripting flexibility. Because Windows script files are not engine-specific, they can contain script from any Windows Script compatible scripting engine. They act as a container.
    features supported by .wsf:

    • Include statements: Incorporate functions from VBScript or JScript files into your Windows Script Host project.
    • Multiple engines: Use more than one scripting language per file.
    • Type libraries: Add constants to your code.
    • Tools: Edit files with any XML editor.
    • Multiple jobs in one file: Store all of your code in a single location.

    Include Statements
    The following example shows a .wsf file that includes a JScript file (fso.js), plus a VBScript function that calls a JScript function (GetFreeSpace) in the included file. The contents of fso.js are also shown.

    Code
    Code

    Multiple-Engine Support
    The following example shows a .wsf file that includes both VBScript and PerlScript code:

    Code

    Type Library Support
    In the following example, "MyComponent" was developed with Microsoft Visual Basic 5.0. "MyComponent" defines the constant MyError with the following statement.

    Public Const MyError = "You are not using MyComponent correctly"

    The type library is contained in mycomponent.lib, which is installed in C:\MyComponent.

    Code

    Tools Support


    Since the .wsf file is in XML format, you can use any editor that supports XML to edit .wsf files. This includes text editors, such as Notepad.
    Multiple Jobs in One File
    Instead of keeping all your scripts in separate files, you can incorporate them all into one .wsf file and break them into several different jobs. You can then run each job separately using syntax similar to the following example, where "MyFirstJob" is the name of the job contained in the MyScripts.wsf file.

    CScript //Job:MyFirstJob MyScripts.wsf
  • 相关阅读:
    我终于会手打lct了!
    [模板]Dijkstra-优先队列优化-单源最短路
    99999999海岛帝国后传:算法大会
    正在加载中。。。。。
    【题解】CF1054D Changing Array(异或,贪心)
    【题解】P4550 收集邮票(概率期望,平方期望)
    【题解】CF149D Coloring Brackets(区间 DP,记忆化搜索)
    【笔记】斜率优化 DP
    CSP2021 游记
    【题解】洛谷P1502 窗口的星星
  • 原文地址:https://www.cnblogs.com/whyandinside/p/1544657.html
Copyright © 2011-2022 走看看