Computing.Net > Forums > Programming > VBS code

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VBS code

Reply to Message Icon

Name: vande
Date: June 1, 2009 at 14:52:24 Pacific
OS: Windows xp
CPU/Ram: Dell percision 530
Product: Dell / Precision 530
Subcategory: General
Comment:

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 Function

How 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..........



Sponsored Link
Ads by Google

Response Number 1
Name: reno
Date: June 1, 2009 at 22:07:11 Pacific
Reply:

wsh.echo ShowDriveLetter("c:")

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


0

Response Number 2
Name: vande
Date: June 3, 2009 at 18:02:52 Pacific
Reply:

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..........


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VBS code

A VB Code for Printed pages counter www.computing.net/answers/programming/a-vb-code-for-printed-pages-counter/12702.html

vb code www.computing.net/answers/programming/vb-code-/10104.html

VB code help www.computing.net/answers/programming/vb-code-help/12893.html