In this tutorial, you will learn how to factory reset a Cisco Switch.
In fact, these steps will work on most Cisco switches and routers models. In this example, I’ll be resetting a Cisco 2960-cx Switch. I’ve used these same all various Cisco models.
Factory reset is easy and is often needed for various reasons including:
- Forgot the password and cannot login
- Purchased a used switch with existing configuration
- Re-deploying switch and need to wipe existing config
- Remove or throw away the device
I’ve seen some online guides suggest running the write erase command to reset a switch. This does not wipe all the data. To truly do a factory reset follow these steps.
Video Tutorial
If you don’t like video tutorials or want more details, then continue reading the instructions below.
Step 1: Console to Switch via Console Cable
Use a terminal emulator program to get console access to the switch. I’ll be using Putty in this example.

Below is a screenshot of my Putty settings for console access to the switch.

Step 2: Power off the Switch
Most Cisco devices have no power-off switch so you will need to just pull the power cord from the Switch. If your device has a power-off switch then use it.
Step 3: Power On & Hold Down Mode Button
The mode button should be on the left front of the switch, this is standard on all Cisco switches.

Power on the switch then hold down the mode button. Hold it down until you see the words “password-recovery mechanism is enabled” then release the mode button. The time on this is different for each model. On the 2960cx I had to hold the mode button for about 1 minute.

This will interrupt the boot process so you can access the command line. Now we are ready to move on to the last step.
Step 4: Use These Commands to Reset
Run the below commands:
1. Type flash_init and hit enter
It could take a minute for it to complete but should say done initializing flash.

2. Type dir flash: and hit enter
Your output may look different than mine but you are looking for the config.text and vlan.dat files. These are the files you need to delete.

3. Type del flash:config.text and hit enter
Type y to confirm
4. Type del flash:vlan.dat and hit enter
Type y to confirm

5. Now type boot and hit enter
The switch will reboot the switch and load the default configuration.

When it’s done rebooting you should see the system configuration dialog.

Summary
In this tutorial, I demonstrated how to factory reset a Cisco switch. These steps should work on all Cisco switch and router models. The output and timing will be different depending on the model but the process should be the same. Make sure you factory reset your gear before throwing it away.