Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Sep 16, 2019 11:52 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Volume Name not showing up
PostPosted: Sat Jun 09, 2012 8:33 am 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
My code: (trying to find an attached Sat Nav system)


Quote:
for drvs = 0 to volumecount-1
d = Volume(drvs)
if d.Name <> "A:" then
if d.Exists then
if instr(d.DisplayName, "GARMIN") > 0 or instr(d.displayname, "nuvi") > 0 then
thenav = d
end if
end if
end if
next


This works fine on a Mac.
On Windows, the drive shows up as F:
Even though Windows Explorer shows it as 'Garmin Nuvi (F:)'
And Properties of the drive has the name as 'GARMIN'

RB2009 5.1

What do I need to do to get the name of the drive in a form that is not a drive letter?
None of the folder item properties expose it, unlike Mac


Top
 Profile  
Reply with quote  
 Post subject: Re: Volume Name not showing up
PostPosted: Sun Jun 10, 2012 11:09 pm 
Offline

Joined: Mon Jan 02, 2006 11:43 am
Posts: 172
Location: Calgary, Alberta, Canada
Hi Kermit,

If the "vol" shell command is used, you get text which contains the volume label.

dim sh as New Shell
#If TargetWin32 Then
sh.execute("vol c:")
#ElseIf TargetMacOS Then
sh.Execute("ioreg -l | grep IOPlatformSerialNumber|awk '{print $4}'")
#EndIf

if sh.errorcode = 0 then MsgBox(sh.Result)

This displays the following information from my C: drive
Quote:
Volume in drive C is MyCDrive
Volume Serial Number is 3333-333333

In this case, the c: drive information is displayed. Keep the text that you want with Left(, or Mid(, or Len( commands.

I hope this helps.

Sincerely,

Eugene
REALStudio 2011 r4.3, Windows 7


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group