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>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />

Example: Dim fso, myFile<br />

Set fso = CreateObject("Scripting.FileSystemObject")<br />

Set myFile = fso.CreateTextFile("c:\testfile.txt", True, False)<br />

myFile.WriteLine("This is a test.")<br />

myFile.Close<br />

Method: Delete<br />

Description: Deletes a specified folder<br />

Use: objFolder.Delete (<strong>for</strong>ce)<br />

Arguments: objFolder<br />

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

<strong>for</strong>ce<br />

Optional. Boolean value that is True if folders with the read-only attribute set are to be<br />

deleted; False if they are not (default).<br />

Return: None<br />

Remarks: An error occurs if the specified folder does not exist. The results of the Delete method on a<br />

Folder are identical to operations per<strong>for</strong>med using FileSystemObject.DeleteFolder. The Delete<br />

method does not distinguish between folders that have content and those that do not. The<br />

specified folder is deleted regardless of whether or not it has content.<br />

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

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

myFolder = $getAppPath() & “HstTemp” ‘Specify the HstTemp folder in app<br />

directory<br />

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

f.Delete ‘Delete it<br />

Method: Move<br />

Description: Moves a specified folder from one location to another.<br />

Use: objFolder.Move (destination)<br />

Arguments: objFolder<br />

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

destination<br />

Required. Destination where the folder is to be moved. Wildcard characters are not allowed.<br />

Return: None<br />

Remarks: The results of the Move method on a Folder is identical to operations per<strong>for</strong>med using<br />

FileSystemObject.MoveFolder. You should note, however, that the alternative methods are<br />

capable of moving multiple folders.<br />

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

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

myFolder = $getAppPath() & “HstTemp” ‘Specify the HstTemp folder in app<br />

directory<br />

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

f.move(“c:\archive”) ‘Move it into c:\archive folder<br />

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

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

Saved successfully!

Ooh no, something went wrong!