WSF is an XML file that allows you to consolidate multiple scripts. This enables the reusability of VBS scripts created for various functions, making it extremely convenient. (Additionally, it allows coexistence of JScript and VBS.)
This time, I will explain how to use it as a package to call multiple VBS files together.
Similar to the functionality previously covered in the article 【VBS】Saving SELECT Results from Oracle DB to CSV but using a combination of batch, WSF, and VBS, we will achieve the same functionality.
First, let's look at the package structure.
▼ wsf_oracledb_to_csv Folder
The WSF file is where VBS scripts are loaded together, allowing you to work with individual functions and classes.
Source Code Explanation
Now, let's explain the code for the WSF and BAT files (we'll skip the VBS files as they have already been explained in a separate article).
WSF File
WSF files are written in XML format.
In this example, we've referenced classes and functions from various VBS files required for DB connection and CSV output.
▼ oracledb_to_csv.wsf
As shown above, you can load multiple VBS files within a WSF file, and you can also directly include VBS scripts in the WSF file itself.
BAT File
▼ main.bat
With this setup, the message boxes won't appear when launching the WSF file, and the processing will proceed as intended."