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: IsRootFolder<br />

Description: Tests to see if the specified folder is the root folder.<br />

Use: boolValue = objFolder.IsRootFolder<br />

Arguments: objFolder<br />

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

Return: True if the specified folder is the root folder; False if not.<br />

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

Example: Dim fso, f, n, 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 />

n = 0<br />

If f.IsRootfolder Then<br />

MsgBox “The app folder is the root folder”<br />

Else<br />

s = myFolder & vbCrLf<br />

Do Until f.IsRootFolder<br />

Set f = f.ParentFolder<br />

n = n+1<br />

s = s & “parent folder is “ & f.Name & vbCrLf<br />

Loop<br />

MsgBox “Folder was nested “ & n & “ levels” & vbCrLf & s<br />

End If<br />

Property: Name<br />

Description: Sets or returns the name of a specified folder<br />

Use: objFolder.Name = newName<br />

strName = objFolder.Name<br />

Arguments: objFolder<br />

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

newName<br />

Optional. If provided, newName is the new name of the specified folder object<br />

Return: The name of the specified folder.<br />

Remarks: Read/write.<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 “folder name is “ & f.Name ‘Returns the folder name<br />

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

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

Saved successfully!

Ooh no, something went wrong!