Chapter 26. Library: File-System Utilities

The file-system utility library provides functions for working with files and folders. Through batch script (.WS) files, you can access these utility functions in any of your scripts. The sections that follow show you the source of the library, as well as how the library can be used.

Examining the File-System Utility Library

Listing 26-1 shows the file-system utility library script. When calling this script from JScript, be sure to pass path information in JScript format with double slashes as folder separators. You do not need to do this from VBScript. Windows Script Host automatically transforms VBScript paths into JScript paths when you call JScript functions from VBScript.

Example 26.1. File-System Utility Library

filesystemlib.js

// ************************
// Script: File System Utility Library
// Version: 1.1.5
// Creation Date: 06/15/2008
// Last Modified: 07/05/2008
// Author: William R. Stanek
// E-mail: williamstanek@aol.com
// ************************ // Description: Provides a utility library for working // with files and folders. // ************************ // Copyright (c) 2008 William R. Stanek // You have a royalty-free right to use these applications, provided // that you give credit to the author AND agree that the author has // no warranty, obligations or liability for any of these library // functions. ...

Get Microsoft® PowerShell, VBScript and JScript® Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.