The “System could not find the environment option that was entered” error message is triggered when there is a problem with the environment variables on your Windows operating system. Environment variables are special values that store information about your system, such as the location of certain folders, files, or programs. They are used by various applications and scripts to perform different tasks. However, these environment variables can get corrupted, or deleted by third-party software, malware, or user errors. This can cause some applications or scripts to malfunction. Fortunately, you can restore your environment variables to their normal state, and this guide will help you with it.
Fix: “The System could not find the Environment option” error on Windows (2023)
You can fix the “System could not find the environment option” error on your Windows desktop by following these steps:
1. Add a new environment variable in Safe Mode
One possible cause of this error is that a specific environment variable called “windir” is missing or broken. This variable points to the Windows directory where your system files are located. It is required by some batch scripts and system applications to run correctly. If this variable is not defined or has an incorrect value, you might get the “System could not find the environment option” error message. Hence, to fix this error, you need a new environment variable called ‘windir’, and you can do it by following these steps:
- First, enter safe mode by restarting your computer and pressing the ‘F4’ key on your keyboard when you see the startup logo. Then select Safe mode from the list of options.
- Once in Safe mode, right-click the Start button and select the ‘System’ option from the pop-up menu.
- Click the ‘Advanced system settings’ hyperlink.
- Then click the ‘Environment Variables’ button on the ‘Advanced’ tab.
- Under the ‘System variables’ section, click the ‘New’ button.
- In the Variable name field, type windir.
- In the Variable value field, type ‘C:\\Windows’ without quotes or wherever your Windows folder is located.
- Then click the ‘OK’ button to save the new environment variable and close all windows.
- Finally, restart your PC and check if the error is fixed.
2. Use System Restore to restore your previous settings
Another possible cause of this error is that some changes have been made to your system settings or registry that have affected your environment variables. This could be due to installing or uninstalling software, updating drivers, or modifying system configurations manually or by malware. To fix this issue, you can use System Restore to revert your system to an earlier point in time when everything was working fine. System Restore is a utility that creates snapshots of your system settings and files periodically or before major changes occur. You can use these snapshots to restore your system to its previous state without affecting your files. Hence, to use System Restore on your Windows desktop, follow these steps:
- First, open the Run dialog box from the Start menu Search box and type “rstrui” without quotes.
- Then click the ‘OK’ button to launch the System Restore wizard.
- Now click the ‘Next’ button and select a restore point from the list that predates the occurrence of the error message.
- You can also check ‘Show more restore points’ option to see more choices.
- If unsure about which restore point to choose, click the ‘Scan for affected programs’ button to see what changes will be made by restoring each point and click the ‘Next’ button.
- Finally, confirm your choice by clicking the ‘Finish’ button.
- Your computer will restart automatically and apply the selected restore point.
3. Perform an SFC scan
Another possible cause of this error is that some of your system files are corrupted or missing due to disk errors. These files include those related to environment variables, such as userenv.dll, setx.exe, cmd.exe, etc. To fix this issue, you can try running an SFC scan by following these steps:
- Open the Command Prompt as an administrator from the Start menu Search box.
- Then type the following command and press the ‘Enter’ key on your keyboard to run the SFC scan:
sfc /scannow
- Now restart your PC to fix the system could not find environment option error.
After using the above methods, make sure to run a virus scan and eliminate malware. Also, delete all the third-party apps that can modify the environment variables to avoid running into, such errors in the future.
That’s everything covered on how to fix the system could not find the environment option error. Also, check out our other guides, such as How to fix the ‘We couldn’t create a new partition’ error on Windows or How to fix the “System error 53 has occurred” on Windows.