Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Removable drives

Hi,
Is there a piece of code to check that a removable drive
is there or not.

Thanks MarkS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Removable drives


Couple of functions you should be able to adapt

Tim


From:
http://msdn.microsoft.com/library/de...us/script56/ht
ml/jscoldrives.asp

Function ShowDriveList
Dim fso, d, dc, s, n
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For Each d in dc
n = ""
s = s & d.DriveLetter & " - "
If d.DriveType = 3 Then '
n = d.ShareName
ElseIf d.IsReady Then
n = d.VolumeName
Else
n = "[Drive not ready]"
End If
s = s & n & vbcrlf
Next
ShowDriveList = s
End Function

Function ShowDriveType(drvpath)
Dim fso, d, t
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive(drvpath)
Select Case d.DriveType
Case 0: t = "Unknown"
Case 1: t = "Removable"
Case 2: t = "Fixed"
Case 3: t = "Network"
Case 4: t = "CD-ROM"
Case 5: t = "RAM Disk"
End Select
ShowDriveType = "Drive " & d.DriveLetter & ": - " & t
End Function





"MarkS" wrote in message
...
Hi,
Is there a piece of code to check that a removable drive
is there or not.

Thanks MarkS



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapped vs Network drives Greg Excel Worksheet Functions 2 January 12th 10 07:16 PM
Network Drives Keith New Users to Excel 2 July 6th 06 10:38 PM
hyperlinks in different drives cdroot4383 Excel Discussion (Misc queries) 2 January 5th 06 07:35 PM
Excel 2003 SP 1 does not search for files on a removable HDD Dmitry Kopnichev Excel Discussion (Misc queries) 4 July 25th 05 08:04 AM
Network drives [email protected] Excel Programming 0 July 17th 03 04:37 AM


All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"