"joshboski" <josh.burkholder@gmail.com> wrote in message
news:4e9ec7fc-5000-4ab5-bbe8-115ebce19dde@j22g2000hsf.googlegroups.com...
> On Jun 3, 9:21 am, Bob I <bire...@yahoo.com> wrote:
>> See "net use" and "If exist" in Windows Help and support. Also there is
>> a cmd prompt group that has some pretty sharp folks(cross posting this)
>>
>> news://msnews.microsoft.com/microsoft.public.win2000.cmdprompt.admin
>>
>> joshboski wrote:
>> > I am currently trying to write a batch file that will delete a list of
>> > files from all of my network drives. The problem I am having is
>> > getting the network drives. I am on a rather large network, and I
>> > would like this to run on several different computers that may be
>> > connected to different drives.
>
> My apologies, that I did not include this also...I need the list of
> local hard drives as well
If you want something a little snazzier then you can use this script
file and massage it to give you the information you want. You need
to invoke it like so in your batch file: cscript //nologo c:\diskparms.vbs
Const Removable = 1
Const Fixed = 2
Const Network = 3
Const CDROM = 4
Const RAMDisk = 5
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set drives = oFSO.Drives
NewLine=Chr(10)
Line = ""
For Each drive In drives
Line = Line & "Drive " & drive.Path
Line = Line & " " & ShowDriveType(Drive)
If drive.IsReady Then Line = Line & ", ready" Else Line = Line & ", not
ready"
If drive.IsReady Then
If drive.DriveType=Network Then
Line = Line & ", Label=" & drive.ShareName
Else
Line = Line & ", Label=" & drive.VolumeName
End If
Line = Line & ", FS=" & drive.FileSystem
Line = Line & ", Total=" & Int(drive.TotalSize/1000000)
Line = Line & ", Free=" & Int(drive.FreeSpace/1000000)
Line = Line & ", Available=" & Int(drive.AvailableSpace/1000000)
Line = Line & ", Serial=" & Hex(drive.SerialNumber)
End If
Line = Line & NewLine
Next
wscript.echo Line
Function ShowDriveType(Drive)
Select Case drive.DriveType
Case Removable
T = "Removable"
Case Fixed
T = "Fixed"
Case Network
T = "Network"
Case CDROM
T = "CD-ROM"
Case RAMDisk
T = "RAM Disk"
Case Else
T = "Unknown"
End Select
ShowDriveType = T
End Function