18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong> <strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong><br />

Property Size<br />

Description: Returns the size of all the files and subfolders contained in the specified folder<br />

Use: intSize = objFolder.Size<br />

Arguments: objFolder<br />

Required. The name of a Folder Object previously instantiated.<br />

Return: The size of the specified folder<br />

Remarks: Size is in bytes<br />

Example: Dim fso, f, myFolder<br />

Set fso = CreateObject(“Scripting.FileSystemObject”) ‘Instantiate the FSO object<br />

myFolder = $getAppPath() ‘Specify the app directory<br />

Set f = fso.GetFolder (myFolder)<br />

MsgBox “Size = “ & f.Size & “ bytes” ‘Display size of app folder<br />

Property SubFolders<br />

Description: Returns a Folders collection consisting of all folders contained in a specified folder,<br />

Use: objFC = objFolder.SubFolders<br />

Arguments: objFolder<br />

Required. The name of a Folder Object previously instantiated.<br />

Return: A folders collection of all subfolders in a specified folder.<br />

Remarks: Includes folders with hidden and system file attributes set.<br />

Example: Dim fso, f, fc, s, myFolder<br />

Set fso = CreateObject(“Scripting.FileSystemObject”) ‘Instantiate the FSO object<br />

myFolder = $getAppPath() ‘Specify the app directory<br />

Set f = fso.GetFolder (myFolder)<br />

fc = f.Subfolders ‘Returns collection of (sub)folders<br />

s = “”<br />

For each f1 in fc<br />

s = s & fc.name & vbCrLf<br />

Next<br />

MsgBox s<br />

Property Type<br />

Description: Returns in<strong>for</strong>mation about the type of a folder.<br />

Use: strType = objFolder.Type<br />

Arguments: objFolder<br />

Required. The name of a Folder Object previously instantiated.<br />

Return: The type of folder.<br />

Remarks: If the object is a folder, “Folder” will be returned.<br />

Example: Dim fso, f, myFolder<br />

Set fso = CreateObject(“Scripting.FileSystemObject”) ‘Instantiate the FSO object<br />

myFolder = $getAppPath() ‘Specify the app directory<br />

Set f = fso.GetFolder (myFolder)<br />

MsgBox “Type = “ & f.Type ‘Displays “Folder”<br />

<strong>InduSoft</strong>, Ltd. 243

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!