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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Property ShareName<br />

Description: Returns the network share name <strong>for</strong> a specified drive.<br />

Use: strName = objDrive.ShareName<br />

Arguments: objDrive<br />

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

Return: A string that is the network share name <strong>for</strong> a specified drive.<br />

Remarks: Read-only. If object is not a network drive, the ShareName property returns a zero-length string<br />

("").<br />

Example: Dim fso, dc, d<br />

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

Set d = fso.GetDrive(“c:”)<br />

If d.DriveType = 3 Then ‘See if a network drive<br />

MsgBox “Network Shared Drive Name = “ & d.ShareName<br />

Else<br />

MsgBox “Not a Network Shared Drive”<br />

End If<br />

Property TotalSize<br />

Description: Returns the total space, in bytes, of a drive or network shared drive.<br />

Use: intSize = objDrive.TotalSize<br />

Arguments: objDrive<br />

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

Return: Integer. The total space, in bytes, of a drive or network shared drive<br />

Remarks: Read-only.<br />

Example: Dim fso, d<br />

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

Set d = fso.GetDrive(“c:”)<br />

MsgBox “Total Drive Size = “ & d.TotalSize & “ bytes” ‘Returns the total size of the drive<br />

Property VolumeName<br />

Description: Sets or returns the volume name of the specified drive. Read/write.<br />

Use: strName = objDrive.VolumeName<br />

objDrive.VolumeName [= newname]<br />

Arguments: objDrive<br />

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

newname<br />

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

Return: String. The volume name of the specified drive.<br />

Remarks: Read/Write.<br />

Example: Dim fso, d<br />

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

Set d = fso.GetDrive(“c:”)<br />

MsgBox “Total Drive Size = “ & d.TotalSize & “ bytes” ‘Returns the total size of the drive<br />

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

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

Saved successfully!

Ooh no, something went wrong!