DOWNLOAD: Best tool to repair Windows problems & optimize system performance | Best driver update software for your PC
Results 1 to 3 of 3

Thread: How to close CD/DVD tray using command line on Windows laptop

  1. #1
    rbhall52 is offline New Member
    Join Date
    Dec 2018

    Default How to close CD/DVD tray using command line on Windows laptop

    I hope I have the right part of this forum for my question.

    I have two Windows 7 laptops, and I have been trying to find out if there is a windows function that I can use to close the DVD tray on these laptops. My wife's laptop's DVD tray comes open occasionally all on it's own, without any apparent prompting, and I would like a command that I can send to windows to close the tray without doing it physically. Of course, if I knew what was causing the tray to open without our prompting to begin with, I would not need such a close command for the DVD tray. Any help would be appreciated.

  2. #2
    HappyAndyK's Avatar
    HappyAndyK is offline Site Administrator
    Join Date
    Jun 2008


    There is no built-in tool in Windows OS to close the DVD/CD tray using the command, but you can download a third party utility called nircmd.exe from and use it for this purpose.

    The syntax is:

    To open - nircmd.exe cdrom open d:

    To close - nircmd.exe cdrom close d:

    Here d: is your CD/DVD drive letter.

    More ways here - Eject or close CD/DVD Tray using Hotkey, Shortcut or Freeware.

  3. #3
    Lewis-H is offline Windows Enthusiast
    Join Date
    Mar 2020


    NirCmd can add Open & Close CD/DVD Tray to Context Menu
    Right-click on the desktop.
    Select New -> Shortcut.
    In the text box that appears, type: C:\Windows\nircmd.exe cdrom open <CD drive letter:> and click Next. ...
    Give a name to the shortcut and click OK to close the shortcut wizard.

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22