Accessing File Folder Properties

Accessing File Folder Properties - Accessing File...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Accessing File Specifications Using JScript One of the primary advantages of using Jscript is that it gives us access to file and folder specifications for individual files. We can call a Jscript program from within a Windows Shell script while we are processing a set of files or folders. The following is a set of sample Jscript programs that can be called from within a Windows Shell script. Example 1: fileSize.js Example 2: folderSize.js 1 // ********************************************************** // * fileSize.js // * This JScript accepts a fully qualified file name // * as an argument and prints the size of the file in bytes // * // ********************************************************** var objArgs = WScript.Arguments WScript.Echo ("Filename = ", objArgs(0)) var fso, f, s; fso = new ActiveXObject("Scripting.FileSystemObject"); f = fso.GetFile(objArgs(0)); s = f.Name + " uses " + f.size + " bytes."; WScript.Echo (s) // ********************************************************** // * folderSize.js // * This JScript accepts a fully qualified file name // * as an argument and prints the size of the file in bytes // * // **********************************************************...
View Full Document

This note was uploaded on 10/21/2010 for the course NETW net230 taught by Professor Dae during the Spring '10 term at DeVry NY.

Page1 / 4

Accessing File Folder Properties - Accessing File...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online