|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Check for a drive
Hello all
Noobe here... I am looking for a way to check for the existance of a local drive and then if that drive exists do some other stuff. The server I am running this on is part of a cluster and will occasionally have the W: drive mounted and occasionally NOT have it mounted. I need the syntax of checking for the existance of the W: drive. This drive will appear to be a local hard drive, if that makes any difference. basicly the logic of what I am looking for is... If Exist W: THEN variable1 = 1 variable2 = 2 Esle Variable1 = 0 Variable2 = 0 EndIf |
|
#2
|
|||
|
|||
|
The filesystem object has a way to iterate the drives on your system. I think there might be example code in the fso documentation.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Well with the hint above I figured out how tod do it, here is a sample code.
Set fso = CreateObject("Scripting.FileSystemObject") Set dc = fso.Drives For Each d in dc If d.driveLetter = "C" THen msgbox "You have a" & " " & D.driveletter & " " & "Drive" End If msgbox d.driveletter NEXT |
|
#4
|
||||
|
||||
|
glad you got it sorted ... thanks for posting the solution
__________________
Come JOIN the party!!! Quote of the Month: Retirement: Because you've given so much of yourself to the company that you don't have anything left we can use. Questions to Ponder: What do you do when you see an endangered animal eating an endangered plant? iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm") copyright© 2008 sbenj69 |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Check for a drive |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|