Tech Support Guy banner
  • Please post in our Community Feedback thread for help with the new forum software! If you are having trouble logging in, please Contact Us for assistance.
Status
Not open for further replies.
1 - 6 of 6 Posts

·
Registered
Joined
·
27 Posts
Discussion Starter · #1 ·
Friends,

Please, does anybody know if exists any system path variable for the CD-DVD drive, such as the following examples?

%SystemDrive%
%SystemRoot%
%WinDir%
Etc.

I have a QuickLaunch shortcut to open the CD-DVD tray, however the command goes like this:

C:\NirCmd\nircmd.exe cdrom open g:

The problem is that I have this external USB CD-DVD drive (actually, it's a Goldship case with a CD-DVD writer in it). Then, every time I turn the case on, it gets a different letter on Windows (Vista). Usually, it's letter G:, but if I already have a flash drive in a different USB port, for example, it will get letter H:, then that QuickLaunch shortcut of mine won't work anymore, for it's targeted to letter G:. Is there any way to use a system path variable for the CD-DVD drive, so that it understands the drive letter automatically and I don't need to inform such letter manually in the shortcut?

Thank you very much for your attention.

brunces
 

·
Retired Trusted Advisor
Joined
·
19,786 Posts
I believe if you go into Disk Management and use the Change Drive Letters and Paths option, you should be able to define it as whatever drive letter you want. Might just want to make it be M: for the sake of argument. I believe it will re-assign to that drive letter when you unplug and replug it back in.
 

·
Retired Trusted Advisor
Joined
·
19,786 Posts
This may work in a batch file as well. Not sure considering it is a removable device.
Code:
for /f "tokens=3 delims=\:" %%I in ('reg query hklm\system\mounteddevices^|findstr /C:"5C003F00"') do set CDROM=%%I:
This code should work. We just need to look in the Registry and see what the hex values are for that particular removable drive.
 

·
Registered
Joined
·
27 Posts
Discussion Starter · #5 ·
Squashman,

Thank you very much for your answers. I did what you said... "nircmd cdrom open", without the drive letter. I do have only one drive. It worked like a charm! I didn't know it was possible to use that command without specifying the drive letter.

I will also try your batch file later.

Thank you very much. :)

brunces
 

·
Retired Trusted Advisor
Joined
·
19,786 Posts
Just keep it simple and use your nircmd. If you look at the help file for nircmd you can see the syntax for the cmd. The batch file will work but I would need to see what the Hex values are for the device in that registry key I am querying in the batch file. If you are familiar with the registry you should be able to figure it out.
 
1 - 6 of 6 Posts
Status
Not open for further replies.
Top