Results 1 to 9 of 9

Thread: looking to eject a dvd using a batch file

  1. #1
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,712
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default looking to eject a dvd using a batch file

    I have a troublesome dvd drive that does not open easily. It seems to think that there is a disc running in the drive even when there isn't one in the drive. The drive isn't running continually either.

    To test this out I am looking to create a batch file that will open the disc drive using a batch file. The way I see it there are a couple ways to do this. I can use devcon or I can use rsm. Both are widows files. For rsm I can write:

    Code:
    rsm.exe eject /ASTART /LG"31FD2701CA4C412794889225B2DC6830"
    To get the above id that I need I write rsm.exe view /TLibrary /GUIDDISPLAY in the command prompt.

    With devcon I can write:

    Code:
    "C:\Documents and Settings\Joseph Vander Jagt\Local Settings\Temp\i386\devcon.exe" disable IDE\CdRomLITE-ON_DVDRW_LH-20A1L__________________BL05____
    "C:\Documents and Settings\Joseph Vander Jagt\Local Settings\Temp\i386\devcon.exe" enable IDE\CdRomLITE-ON_DVDRW_LH-20A1L__________________BL05____
    But this no longer seems to be working. To be honest, it has been a while since I have tested it out, so it may not have fully worked in the first place. Either way I have not found an eject command among the list of commands that can be used.

    Is anyone familiar with writing a batch file to open the dvd drive?
    To choose the lesser of two evils is still to choose evil. My personal site

  2. #2
    Join Date
    Mar 2011
    Location
    N 11░ 19' 0.0012 E 142░ 15' 0
    Posts
    1,519
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default

    There's no inbuilt function that does this.
    There's a plugin that does this, but you'd need to go download it. http://www.nirsoft.net/utils/nircmd.html
    I've never actually used it.

    Edit -
    One more thing I thought of:
    I have a kind of library that allows you to do more things with batch and the cmd (a whole pile of files that acts as a kind of plugin) (I made it).
    One of them opens the cd drive... I could send it to you if you want

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    My not-so-helpful advice would be to have a paperclip ready

    I really have no idea about programming a batch file for that. KB's link seems useful.

    Have you tried to (re)install drivers for it? It sounds like that could be the issue to me.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,712
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    The first code is the inbuilt function to do open the dvd drive. I was thinking that possibly my syntax is wrong though since it asks me for more instructions. I will try that link. I saw it earlier, but I am always hesitant about 3rd party mods for windows. I would love to see a sample of the batch command you have to open the cd drive keyboard.

    I have tried most everything with the drivers. That was my first and best guess too. I still think it has to do with the drivers, but somehow I am still missing something though.

    I wish I could give more details, but I need to run to work now.

    Later.
    Last edited by james438; 11-18-2012 at 05:30 AM. Reason: minor formatting
    To choose the lesser of two evils is still to choose evil. My personal site

  5. #5
    Join Date
    Mar 2011
    Location
    N 11░ 19' 0.0012 E 142░ 15' 0
    Posts
    1,519
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default

    Just to clarify, my batch mod isn't actually written in batch.
    It's programmed in an external language, then the cmd can access it to do things that it can't normally do.
    I've tested it heaps and there has never been a problem.

    I'll pm it to you if you're interested James with instructions on how to use it (I don't want to release it to everyone)
    It is an exe, so only use it if your willing.
    (it doesn't actually change the cmd in any way... just places files in the right place to make them work with the cmd )

  6. #6
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    47
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  7. The Following User Says Thank You to bernie1227 For This Useful Post:

    james438 (11-18-2012)

  8. #7
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,712
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    I'm still looking into this as a back burner project, but that link you posted is quite helpful. I now have a batch file (extremely simple) that will open the dvd drive. It still refuses to open, but it refuses to stop trying to open the DVD drive until it succeeds. This will help me immensely as I attempt to create a work around for this problem. I almost never use my DVD drive, so the problem is slow in getting fixed.

    Thank you for your posts everyone. You have all been helpful in giving me further insight into this Widows software problem.
    To choose the lesser of two evils is still to choose evil. My personal site

  9. #8
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    1,712
    Thanks
    82
    Thanked 90 Times in 88 Posts

    Default

    What sort of things does your cmd mod do? I am newer to writing batch files and using the command prompt.

    I am very greatful to Windows for the command prompt too. In fact I have greater faith in windows products for making available such tools as C++, regedit, the command prompt, run, devcon, rsm.exe and a host of other Widows tools. They are simple, slim, with many commands and are not dumbed down for people who don't want a lot of options.
    To choose the lesser of two evils is still to choose evil. My personal site

  10. #9
    Join Date
    Mar 2011
    Location
    N 11░ 19' 0.0012 E 142░ 15' 0
    Posts
    1,519
    Thanks
    41
    Thanked 89 Times in 88 Posts
    Blog Entries
    3

    Default

    I'm remaking all the functions that it already has, and adding in some new ones.
    An obvious example is my wait command. Instead of having to ping an invalid ip address for a certain number of seconds, this actually waits for that number of seconds...

    It's also got a slightly different structure than the cmd. Most of the commands use parameters like -s -w -f and so on. Mine don't use those, the parameters must be passed in the correct order, but I've built in a fair bit of error checking...

Similar Threads

  1. My Dvd rw drive button eject do not function,so I eject from WIN EXPLORER what to do
    By leonidassavvides in forum Computer hardware and software
    Replies: 7
    Last Post: 01-20-2009, 09:27 AM
  2. Script to execute a batch file
    By smithster in forum ASP
    Replies: 4
    Last Post: 05-22-2007, 10:11 PM
  3. Batch file problem
    By neo_philiac in forum The lounge
    Replies: 3
    Last Post: 12-01-2006, 03:57 AM
  4. Writing a javascript array using a batch file
    By jscheuer1 in forum Coding tips & tutorials threads
    Replies: 5
    Last Post: 11-06-2006, 05:31 AM
  5. Replies: 1
    Last Post: 03-01-2006, 03:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •