Monday, February 21, 2011

Get Detail of Object Drive


Dim filesys
set filesys = CreateObject("Scripting.FileSystemObject")
Set drv = filesys.GetDrive("e")

select case drv.DriveType
                Case 0: drtype = "Unknown"
                Case 1: drtype = "Removable"
                Case 2: drtype = "Fixed"
                Case 3: drtype = "Network"
                Case 4: drtype = "CD-ROM"
                Case 5: drtype = "RAM Disk"
End Select

WScript.Echo "The specified drive is a " & drtype & " type disk."
WScript.Echo " "
WScript.Echo "Total size is " & drv.TotalSize & ". "
WScript.Echo "Available space is " & drv.AvailableSpace &  ". "
WScript.Echo "Type is " & drv.DriveType &  " "
WScript.Echo "Path is "  & drv.Path &  " "

Dim filesyst, drive
Set filesyst = CreateObject("Scripting.FileSystemObject")
WScript.Echo "Before Condtion"

drive =  filesyst.DriveExists("z")
WScript.Echo drive

                If filesyst.DriveExists("z") Then
                                WScript.Echo("The specified drive does exist.")
                Else
                                WScript.Echo("The specified drive does not exist.")
                End If
WScript.Echo "After Condtion"

No comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | JCpenney Printable Coupons