A method for controlling an electronic device capable of operating as an external device of an information processing apparatus, the electronic device including a rechargeable battery, the method comprising the steps of:
- when the electronic device is connected to an interface having a power-supply function,
- performing operating-mode management of a device that does not include a mode selection switch, said operating mode management being responsive to connection of the electronic device to the interface by selecting one of a normal operating mode in which the electronic device operates as a hard disk unit of the information processing apparatus, and a charging mode in which the electronic device stops operating as the hard disk unit of the information processing apparatus and charges the rechargeable battery;
- and
- performing command processing in accordance with the selected operating mode.