SamLogic
pilTips & Tricks for CD-Menu Creator

Tip: How to get the drive letter of the CD / DVD / USB flash drive where the menu is run

Sometimes it is necessary to know the drive letter of the CD / DVD or USB flash drive where the menu is run.
This tip shows how to use a variable with the name %SRCDRV to get the information.

This tip assumes that you have a program named MyProgram.exe in the folder c:\program\myprogram on your harddisk.
This tip also assume that you want to pass the path <Drive>MyDocuments\Info.txt to this program as a parameter.

To use the %SRCDRV variable to get the drive letter, do the following:

1. Start CD-Menu Creator
2. Click on the Buttons (text) tab and click the Add Button button
3. Click the button marked with three dots ("...") to the right of the Source File text box. Browse for the program MyProgram.exe.
4. In the Parameters input field, enter the text: %SRCDRV\MyDocuments\Info.txt



6. Click Ok to close the dialog box

As you can see a variable with the name %SRCDRV is used in the Parameters input field. This variable is placed first in the file path. When the menu is copied to a CD / DVD or USB flash drive and is inserted in drives with various drive letters the %SRCDRV variable will be changed to the correct drive letter. So if for example the user inserts the CD / DVD / USB flash drive in the F: drive, the path that is sent to the program via the Parameters field will be F:\MyDocuments\Info.txt.
 
  
Back to Tips and Tricks for CD-Menu Creator
  
  

Copyright © by SamLogic. All rights reserved.