Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Function ShowDriveLetter(drvPath)
Dim fso, d, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive(fso.GetDriveName("c"))
s = "Drive " & d.DriveLetter & ": - "
s = s & d.VolumeName & "
"
s = s & "Free Space: " & FormatNumber(d.FreeSpace/1024, 0)
s = s & " Kbytes"
ShowDriveLetter = s
End FunctionHow can I get the drvpath to be c:
I have tried everything? So im not just asking for the answer/..
also this is not a homework assignment just persoanl research. I kinda think drvpath should be drvpath cause it represents %drvpath% per se
But where can I declar drvpath = "c:" <--- and its not this easy
Learning in progress..........

wsh.echo ShowDriveLetter("c:")
Function ShowDriveLetter(drvPath)
Dim fso, d, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set d = fso.GetDrive(fso.GetDriveName(drvPath))
...
....

If I can ask one question why is wsh.echo at the top ?
Where is the logic in that?
what I mean is does the code run what is inside the function area first then run anythign outside?
Learning in progress..........

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |