Page 1 of 1 1
Topic Options
#110039 - 2003-12-10 08:35 PM Drive Mappings + Message Box
oobnuker Offline
Getting the hang of it

Registered: 2003-12-09
Posts: 87
Loc: Oxford, CT
I tried a number of searches and got no results. I am trying to display drive mappings in a messagebox. I tried something like this:
Code:

$mappings = (USE LIST)



But that didn't work - is there a way to do this?

Thanks!
_________________________
-- oobnuker - .KIX hack - no really.

Top
#110040 - 2003-12-10 08:39 PM Re: Drive Mappings + Message Box
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Enumarating mapped drive can be done whit a udf fom the udf forum like this one: http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB12&Number=81931&Forum=UBB12&Words=enumerate%20drives&Match=Entire%20Phrase&Searchpage=0&Limit=25&Old=allposts&Main=81931&Search=true#Post81931
Enumerate all drives into one variable and this can be displayed in a messagebox.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#110041 - 2003-12-11 05:24 PM Re: Drive Mappings + Message Box
oobnuker Offline
Getting the hang of it

Registered: 2003-12-09
Posts: 87
Loc: Oxford, CT
Is there any way you could give me a little push with a code snippet? I checked that link out, and it does enumerate the drives - but I can't figure out how to get that info back into a variable - I'm kinda new to KIX!

Thanks!
_________________________
-- oobnuker - .KIX hack - no really.

Top
#110042 - 2003-12-11 05:32 PM Re: Drive Mappings + Message Box
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Did you take a look at the examples?
Code:

for each $drive in WshEnumDrives()
$driveletter=$drive.driveletter
? "DriveLetter .... "+$driveletter
next

_________________________
There are two types of vessels, submarines and targets.

Top
#110043 - 2003-12-11 05:37 PM Re: Drive Mappings + Message Box
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
What is your main objective for the drive info? This will display them all in a pretty list message box.

Code:
for each $drive in WshEnumDrives()

If $drive.sharename = ""
$sharename = "Local"
Else
$sharename = $drive.sharename
Endif
$msgstring = $msgstring+$drive.driveletter+" - "+$sharename+@CRLF
next

$null = messagebox ($msgstring, "Current Drives", 0)

function WshEnumDrives()
dim $fso
$WshEnumDrives = ""
$fso = createobject("scripting.filesystemobject")
if $fso
$WshEnumDrives = $fso.drives
endif
exit @error
endfunction



Edited by CitrixMan (2003-12-11 05:39 PM)

Top
#110044 - 2003-12-11 10:52 PM Re: Drive Mappings + Message Box
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Quote:

Did you take a look at the examples?
Code:

for each $drive in WshEnumDrives()
$driveletter=$drive.driveletter
? "DriveLetter .... "+$driveletter
next






Oobnuker:

This example shown by Jens will put a drive into the $drive variable. And continue to the next drive. In between it does something (in this case it shows each drive on screen) with each drive.
This also could be changed to your needs.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 661 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.083 seconds in which 0.067 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org