For factory reset on a Cisco IOS (switch / router ), can use below commands Switch: SWITCH_IGNORE_STARTUP_CFG=1 Switch:boot switch>en Switch: factory-reset all