spacer
Yehuda Shiran November 22, 2000
Probing Drives
Tips: November 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

You can use JavaScript to get a lot of information about the drives in your system, both disk drives as well shared networks. A drive object is created using the GetDrive() method of the FileSystemObject object. The syntax is as follows:

GetDrive(letterDrive);
The single parameter, letterDrive, is the given drive name. This method returns the drive object. The following script should create a drive object for f:

<SCRIPT LANGUAGE="JavaScript">
<!--
var fso = new ActiveXObject("Scripting.FileSystemObject");
driveObj = fso.GetDrive("f");
-->
</SCRIPT>
The drive object does not have any methods. Here are the drive object's properties:

PropertyDescription
AvailableSpaceReturns the number of free bytes on the given drive
DriveLetterReturns the drive letter of a physical local drive or a shared network
DriveTypeReturns the drive type
FileSystemReturns the file system type for the specified drive
FreeSpaceReturns the number of free bytes on the given drive
IsReadyReturns the status of the drive
PathReturns the path of the given drive
RootFolderReturns the folder object of the root folder
SerialNumberReturns the unique serial number of the volume
ShareNameReturns the shared name of a network drive
TotalSizeReturns the total number of bytes on a specified drive
VolumeNameSets or returns the volume name of the specified drive


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business