![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | C drive name Im trying to simply get the drive name of the C drive. Nothing else. Unfortunetely all the scripts I see and play with want to look at all the drive letters A C D E etc and give me names if there is one. How can I just get the C drive name. I have the following script which is nice. But cant narrow it down just to the C drive. '-------------------------------------------------------------------------------------- ' LogicalDisk.vbs ' Sample VBScript to interrogate a Logical disk with WMI ' Author Guy Thomas http://computerperformance.co.uk/ ' Version 1.8 - November 2005 ' -------------------------------------------------------------' Option Explicit Dim objWMIService, objItem, colItems, strComputer On Error Resume Next strComputer = "." Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * from Win32_LogicalDisk") For Each objItem in colItems Wscript.Echo "Computer: " & objItem.SystemName & VbCr & _ " ==================================" & VbCr & _ "Drive Letter: " & objItem.Name & vbCr & _ "Description: " & objItem.Description & vbCr & _ "Volume Name: " & objItem.VolumeName & vbCr & _ "Drive Type: " & objItem.DriveType & vbCr & _ "Media Type: " & objItem.MediaType & vbCr & _ "VolumeSerialNumber: " & objItem.VolumeSerialNumber & vbCr & _ "Size: " & Int(objItem.Size /1073741824) & " GB" & vbCr & _ "Free Space: " & Int(objItem.FreeSpace /1073741824) & _ " GB" & vbCr & _ "Quotas Disabled: " & objItem.QuotasDisabled & vbCr & _ "Supports DiskQuotas: " & objItem.SupportsDiskQuotas & vbCr & _ "Supports FileBasedCompression: " & _ objItem.SupportsFileBasedCompression & vbCr & _ "Compressed: " & objItem.Compressed & vbCr & _ "" Next WSCript.Quit |
My System Specs![]() |
| | #2 (permalink) |
| | Re: C drive name thanks Tom Works like Bill Gates wrote it himself. Ok it works better. Thnaks. Regards |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Combo RAID1 and standard Drive setup problem - Unallocated Drive | General Discussion | |||
| Complete PC Backup to external hard drive: share the drive? | Vista General | |||
| Access XP data drive using Vista Ult (XP drive=slave drive only NO | Vista account administration | |||
| Vista on the C: drive but System drive is the D: drive - any way to | Vista installation & setup | |||
| Vista maping drive to server 2000 shared drive not recognize user/ | Vista networking & sharing | |||