From: Mirage on 26 Sep 2006 19:46 I am having a hard time trying to check if my MP3 player is connected to the USB port of the computer. I don't know where to check. It shows in "My Computer" as opposed to a hard drive. It shows as "SanDisk Sansa c150" in "My Computer" and doing a search shows it also in "Portable Media Devices" I tried using the FileSystemObject's FolderExists function but it always hits the "Else" clause. Is there anyway to check for items in the "My Computer" area? This doesn't work. I tried it with the player both connected and disconnected, and it always hit the "Else". Please help! ----------------------------------------------------------------------------------------- If fso.FolderExists("My Computer\SanDisk Sansa c150") Then MsgBox "MP3 Player is connected" Else MsgBox "MP3 Player not found" End If -----------------------------------------------------------------------------------------
From: BeastFish on 27 Sep 2006 13:10 Don't have a SanDisk MP3 player myself. Does it show up as a disk drive? I.e. "F:\SanDisk Sansa c150"? If so, it's probably added as a flash drive. Try enumerating the disk drives (GetLogicalDriveStrings and GetDriveType API functions). Try enumerating them backwards, as flash drives are typically added to the end of the list. HTH "Mirage" <EHarris1972(a)hotmail.com> wrote in message news:1159314413.663254.231520(a)b28g2000cwb.googlegroups.com... > I am having a hard time trying to check if my MP3 player is connected > to the USB port of the computer. I don't know where to check. It > shows in "My Computer" as opposed to a hard drive. It shows as > "SanDisk Sansa c150" in "My Computer" and doing a search shows it also > in "Portable Media Devices" I tried using the FileSystemObject's > FolderExists function but it always hits the "Else" clause. Is there > anyway to check for items in the "My Computer" area? > > > This doesn't work. I tried it with the player both connected and > disconnected, and it always hit the "Else". Please help! > -------------------------------------------------------------------------- --------------- > If fso.FolderExists("My Computer\SanDisk Sansa c150") Then > MsgBox "MP3 Player is connected" > Else > MsgBox "MP3 Player not found" > End If > -------------------------------------------------------------------------- --------------- >
From: Mirage on 27 Sep 2006 19:04 BeastFish wrote: > Don't have a SanDisk MP3 player myself. Does it show up as a disk drive? > I.e. "F:\SanDisk Sansa c150"? If so, it's probably added as a flash drive. > Try enumerating the disk drives (GetLogicalDriveStrings and GetDriveType API > functions). Try enumerating them backwards, as flash drives are typically > added to the end of the list. Thanks for the reply. I tried using the GetLogicalDriveStrings API like you said, and it only shows drive letters. It won't show non-drive-letter items. If you plugin a digital camera, MP3 player, etc, they appear in "My Computer" without an associated drive letter. Are there any other ways or API's that you can suggest that may work. I really want to create an app to manage the files on my MP3 player, but I can't even find the player using code, so I'm kinda stuck. Please help me think of a way to find the player. If someone has code that finds a digital camera in "My Computer" then please let me know, because it may be the same code to find MP3 players. Thanks, Sincerely, Pulling-my-hair-out-going-insane.
From: Mirage on 27 Sep 2006 19:08 BeastFish wrote: > Don't have a SanDisk MP3 player myself. Does it show up as a disk drive? > I.e. "F:\SanDisk Sansa c150"? If so, it's probably added as a flash drive. > Try enumerating the disk drives (GetLogicalDriveStrings and GetDriveType API > functions). Try enumerating them backwards, as flash drives are typically > added to the end of the list. Thanks for the reply. I tried using the GetLogicalDriveStrings API like you said, and it only shows drive letters. It won't show non-drive-letter items. If you plugin a digital camera, MP3 player, etc, they appear in "My Computer" without an associated drive letter. Are there any other ways or API's that you can suggest that may work. I really want to create an app to manage the files on my MP3 player, but I can't even find the player using code, so I'm kinda stuck. Please help me think of a way to find the player. If someone has code that finds a digital camera in "My Computer" then please let me know, because it may be the same code to find MP3 players. Thanks, Sincerely, Pulling-my-hair-out-going-insane.
From: Frank Adam on 27 Sep 2006 20:13 On 27 Sep 2006 16:08:51 -0700, "Mirage" <EHarris1972(a)hotmail.com> wrote: >BeastFish wrote: >> Don't have a SanDisk MP3 player myself. Does it show up as a disk drive? >> I.e. "F:\SanDisk Sansa c150"? If so, it's probably added as a flash drive. >> Try enumerating the disk drives (GetLogicalDriveStrings and GetDriveType API >> functions). Try enumerating them backwards, as flash drives are typically >> added to the end of the list. > > >Thanks for the reply. I tried using the GetLogicalDriveStrings API like >you said, and it only shows drive letters. It won't show >non-drive-letter items. If you plugin a digital camera, MP3 player, >etc, they appear in "My Computer" without an associated drive letter. >Are there any other ways or API's that you can suggest that may work. >I really want to create an app to manage the files on my MP3 player, >but I can't even find the player using code, so I'm kinda stuck. >Please help me think of a way to find the player. If someone has code >that finds a digital camera in "My Computer" then please let me know, >because it may be the same code to find MP3 players. > Tried GetVolumeInformation ? The volume name may show up the drive. something like: (aircode) dim s as string * 1000, ss() as string dim i as long dim sVolume as string * 100, sFileSys as string * 100, flags as long dim serial as long call getlogicaldrivestrings(1000,s) i = instr(s,chr$(0) & chr$(0)) if i then s = left$(s,i-1) endif ss = split(s,chr$(0)) for i = lbound(ss) to ubound(ss) getvolumeinformation ss(i),sVolume,100,serial,0,flags,sfilesys,100 debug.print ss(i), ctrim(sVolume),serial,ctrim(sfilesys) next You may also want to throw a GetDriveType in there somewhere to cut down on the unwanted ones. Btw, as far as i know, all disklike devices will get a temporary drive letter, even if MyComputer may not show it. -- Regards, Frank
|
Next
|
Last
Pages: 1 2 3 4 Prev: Run-time error '-2147221020 (800401e4) please help Next: Packaging Program |