Abstract: An electronic apparatus includes a casing, a first sliding tray module, a second sliding tray module, a switch module and a main board. The first sliding tray module includes a first belt unit, a baffle is disposed on one end of the first belt unit. The switch module includes an elastic piece and a switch. The first sliding tray module and/or the second sliding tray module slide/slides in or out to make the elastic piece and the baffle touched or untouched. The switch generates a switch signal according to whether the elastic piece and the baffle being touched or untouched. While the elastic piece and the baffle are untouched, the main board is configured to generate a detecting time according to the switch signal, and while the detecting time is longer than a safe time, the main board generates a warning signal through the electronic apparatus.