Category filter

Script to reset Firefox to default state on Windows

This document helps you with a script to reset Firefox browser on Windows devices.

Resetting a web browser helps address issues that affect its functioning. For instance, over time, web browsers may become slower due to the accumulation of stored cookies and caches. Moreover, as the users may download browser extensions to customize their needs, it could inadvertently pose a security risk if they are malicious. So, resetting the browser could eliminate such extensions and restore browser security and performance.

Mozilla Firefox is one of the popular web browsers that are known for its security, speed, and user-friendly browsing experience. Manually resetting Firefox on Windows PCs requires users to locate Firefox’s Profiles folder within its directory, delete it, and then restart the browser. But by using the PowerShell script provided below, IT administrators can easily reset Firefox to its default state using Hexnode’s “Execute Custom Script” action.


The sample scripts provided below are adapted from third-party open-source sites.

Script to reset Firefox browser on Windows

The script given above will fetch the username (Replace the with the actual username of the account on the Windows device) and check for that user’s Firefox profile folder. If the folder is found, then it will close all the running instances of Firefox and delete the “profiles.ini” file. After the execution of the script, Firefox will be reset, and all the settings and configurations will return to their default state.

You can validate the working of the script by referring to the Action History tab of that corresponding device.

The script to reset Firefox to its default settings for the current user has been successfully executed

What happens at the device end?

Executing the script will cause Firefox to open in its default state, as if it has been opened for the first time.

The Firefox browser has been reset to its default state


  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository