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

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management
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.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

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

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags