473,386 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How could i get CDROM Drive Letter using VB6.0 code

Hi all,
How could i get CDROM Drive Letter using VB6.0 code. Where i run application that should get cdrom drive letter so, i need help.
Oct 17 '06 #1
1 5192
Killer42
8,435 Expert 8TB
Hi all,
How could i get CDROM Drive Letter using VB6.0 code. Where i run application that should get cdrom drive letter so, i need help.
Try this little working demonstration...
Expand|Select|Wrap|Line Numbers
  1. Dim fso As New FileSystemObject
  2. Dim drv As Drive
  3. For Each drv In fso.Drives
  4.   With drv
  5.   Debug.Print .DriveLetter, .DriveType, .FileSystem
  6.   End With
  7. Next
Note that this code produced a runtime error ("Disk not ready") when it hit my CDROM drive (with no disk inserted). That's just due to trying to access the ".FileSystem" property, which comes from the disk, rather than the drive. In case you're not familiar with it, you need to add the "Microsoft Scripting Runtime" in the "References" for the project. Just based on my output, it looks as though the drive types are:
2 = HDD
3 = network drive
4 = CDROM (or similar)
Nov 6 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: enclume42 | last post by:
Hello, I am a pure Linux guy. I wrote a Java program that is going to be used by some Windows people, and I wish the startup of the program to be as simple as possible, namely to double-click on...
3
by: M | last post by:
I searched the FAQ for this NG and found no answers to my question... I'm writing an application in Java (I'm not a C programmer), however I need to be able to detect WHICH drive (d:\, e:\...
9
by: Paul Steele | last post by:
I am writing a C# app that needs to periodically poll for cdroms and usb storage device insertions. I've looked at the WMI functions but haven't found anything all that useful. The closest is...
7
by: jimdscudder | last post by:
How can I use WMI or a WqlObjectQuery to find the hard drive letter of the physical drive location index. For example the following code will give me the physical drive location:...
4
by: sanjana | last post by:
hi i m using the win32_diskdrive class for detecting a memory card insertion and removal..and this class detects memory card(sd card..etc) insertion removal from the device the deviceid...
2
by: Aristeidis Bampakos | last post by:
I am calling an ASP .NET page through the Web, save it locally and then burn it on a CD. How can I determine the path of the CDROM in which the page resides since each user may have a different drive...
2
by: Kavitha | last post by:
Hi , Can any one tel me how to create a virtual drive in C#( similar to Gmail Virtual drive).Also tell me what interfaces could be used to create the same. Thanks in Advance Kavitha
3
by: Ognjen Bezanov | last post by:
Hello, I am trying to control a CD-ROM drive using python. The code I use is shown below.
1
by: awking | last post by:
I have reformatted an older Windows98 computer, using a format command installed on a floppy. The C drive is now clear of any files as expected. The computer now recognizes the floppy A drive, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.