Skip to content
blackcrack edited this page Jul 15, 2021 · 1 revision

Command Line

When using the program on the command line, settings that have been created when using the program normally may still be used. If USB_Disk_Eject.cfg is found in the same folder as the program then it will read and use settings from it. Settings such as removal notifications will be dictated by what has been set in options if this file is present.

This is particularly important when dealing with memory cards and card readers. For example if a device has been defined as a card reader in options then when ejecting the program will honor this and eject the card media not the card reader device.

If you dont want the program to inherit options then make sure that USB_Disk_Eject.cfg is not present in the same folder.

The following command line options are available:

  • /? Displays a dialog that shows all command line options.

  • /CFGDIR
    switch to let you specify a different location for the cfg file that stores all the settings.

  • /NOSAVE
    Settings are not saved, no cfg file will be created. But if theres USB_Disk_Eject.cfg in the same place as the program, options will be read from it. Use this if you want to launch the program but stop it saving settings or overwriting existing settings.

  • /REMOVETHIS
    Ejects the drive that the program is running from. Eg if the program is run from a usb stick on drive G then drive G would be ejected.

  • /REMOVELETTER
    Ejects the specified drive letter. Eg /REMOVELETTER G

  • /REMOVEMOUNTPOINT
    Ejects the specified mountpoint. Eg /REMOVEMOUNTPOINT "C:\Test USB Disk Mount"

  • /REMOVENAME
    Ejects the drive with the specified name. Eg /REMOVEDRIVE "Sandisk U3 Titanium" Partial name matching is possible if a wildcard (*) is used. Eg /REMOVENAME "*SANDISK" would eject a drive that had Sandisk in its name.

  • /REMOVELABEL
    Ejects the drive with the specified label. Eg /REMOVLABEL "Work Drive" Partial name matching is possible if a wildcard (*) is used. Eg /REMOVELABEL "*BEN" would eject a drive that had Ben in its label (eg Ben's Pen Drive).

  • /SHOWEJECT (version 1.3.0.5)
    let popup an small Info at the Systray

  • /EJECTCARD (version 1.3.0.5)
    Ejects the card media from a drive rater than trying to eject the drive itself Combine it with other switches Eg /REMOVELETTER G /EJECTCARD would eject an SD card and drive G.

The command line switches could be used to eject a drive from the command prompt, a bat file, a desktop shortcut or as part of a script or menu.

If you are upgrading from a previous version of USB Disk Eject be aware that some command line switches have been removed: /SILENT
/SHOWEJECT
/CLOSEAPPS
/CLOSEAPPSFORCE

Clone this wiki locally