Jump to content
Sign in to follow this  
yqf0215

How to map IDE/USB cdrom to scsi id?

Recommended Posts

yqf0215

I'm Using some ide and usb cdroms in one computer, and I need readcd to create iso files from cdrom.

My First problem is that: readcd is a linux program and runs under windows within cygwin. The program readcd can't use the cdrom's name ,likes "f:", it uses scsi bus ,eg(readcd -scanbus):

scsibus1:
        1,0,0   100) *
        1,1,0   101) 'TSSTcorp' 'CD/DVDW TS-H653L' 'HA03' Removable CD-ROM
        1,2,0   102) *
        1,3,0   103) *
        1,4,0   104) *
        1,5,0   105) *
        1,6,0   106) *
        1,7,0   107) HOST ADAPTOR

I try many way,but I can't map the 1,1,0 to the "f:".

Func _Drive_Map_SCSI( $Drive, $Computer = ".")
   If DriveGetType($Drive) <> "CDROM" Then Return SetError(1)
   Local $scsi = ""
   $Drive = StringUpper($Drive)
   $Obj_CD = ObjGet("winmgmts:\\" & $Computer & "\root\cimv2")
   $Items = $Obj_CD.ExecQuery("Select * from Win32_CDROMDrive ")
   For $Item in $Items
$scsi=$Item.SCSIPort  &"," & $Item.SCSITargetId &","&$Item.SCSILogicalUnit&","&$Item.SCSIBus
      ConsoleWrite("!========================================================" & @CRLF)
        ConsoleWrite("id:" & $Item.id & @CRLF)
        ConsoleWrite("scsi:" &$scsi & @CRLF)
        ConsoleWrite("!========================================================" & @CRLF)
   Next
  
   Return $scsi
EndFunc  ;<==> _Drive_Map_SCSI()

And the second,when I insert an USB CDRom, that return

id:H:
,,,

In fact ,I run "readcd -scanbus ",it return

scsibus4:
        4,0,0   400) 'PIONEER ' 'DVD-RW  DVR-112 ' '1.21' Removable CD-ROM
        4,1,0   401) *
        4,2,0   402) *
        4,3,0   403) *
        4,4,0   404) *
        4,5,0   405) *
        4,6,0   406) *
        4,7,0   407) HOST ADAPTOR

May who help me!

Edited by yqf0215

Share this post


Link to post
Share on other sites
Fire

Hi,

I`m using cygwin too on my xp sp2.But i have`nt readcd component in my env.So i cann`t imagine this problem in my system.

BTW may be =>

wmic cdrom get Name,Drive,ID
with runwait () ?

May be it helps to you?

Output in my system:

C:\>wmic cdrom get Name,Drive,ID
Drive Id Name
I:  I: Optiarc DVD RW AD-5170A

[size="5"] [/size]

Share this post


Link to post
Share on other sites
yqf0215

Hi,

I`m using cygwin too on my xp sp2.But i have`nt readcd component in my env.So i cann`t imagine this problem in my system.

BTW may be =>

wmic cdrom get Name,Drive,ID
with runwait () ?

May be it helps to you?

Output in my system:

C:\>wmic cdrom get Name,Drive,ID
Drive Id Name
I:  I: Optiarc DVD RW AD-5170A

Thanks for your reply.

but I want the scsi id,just like the "1,1,0" ,wmic only return the Driver Letter.

Do someone know ?

Share this post


Link to post
Share on other sites
TheSaint

I've been playing around lately with an addon for my CDIni Database program, that uses parts of Cdrtools.

Here's the somewhat overblown simple test I've come up with so far, which uses the Windows tool wmic.exe to match drive letters to scsi bus data.

CDRTools Test.au3

NOTE - This has only been tested with WinXP SP2. I also had a fair amount of trouble with catching the console output, even though SciTE always got it easily.

Edited by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×