Yes.
However, if you connect to a port that has difficulty providing a stable power supply, such as a bus-powered USB hub, the batteries might run down. To avoid a sudden power-off due to battery exhaustion, connect to a USB 2.0 or higher port that is able to supply power.