|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Looking for local drives on a server.
I need to write a script that will search for files on a server...the first thing I need to do is search for all local disks on the machine.
Does anyone have any advice on how to do this? Thanks in advance! Josh |
|
#2
|
|||
|
|||
|
You could add a reference to the Microsoft Scripting runtime and use the filesystem object to navigate drives & folders.
Look in http://msdn.microsoft.com/library in the Web Development chapter for the Scripting documentation. Or you can use the built-in VB6 disk functions, look in the VB documentation for details. There may be different options in VB.NET |
|
#3
|
||||
|
||||
|
yeah, in .NET just add a reference (ie, imports statement) to the system.io namespace. I would definitely go for the FSO in VB6 - very easy to deal with
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
|
#4
|
|||
|
|||
|
This is a sample on msdn:
Sub ShowDriveList Dim fs, d, dc, s, n Set fs = CreateObject("Scripting.FileSystemObject") Set dc = fs.Drives For Each d in dc s = s & d.DriveLetter & " - " If d.DriveType = 3 Then n = d.ShareName Else n = d.VolumeName End If s = s & n & vbCrLf Next MsgBox s End Sub http://msdn.microsoft.com/library/d...vaprodrives.asp |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Looking for local drives on a server. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|