If you’re getting the ERROR BAD ENVIRONMENT error code 10 with The environment is incorrect description, follow the troubleshooting steps listed in this article to fix it.
The environment is incorrect: Error background
This error can affect various Windows components, as well as third-party apps and hardware. The bad environment error often occurs when users try to copy or print files, as well as when they access various built-in Windows tools, such as the Registry Editor, Command Prompt, etc. Most likely, error 10 is triggered by invalid, damaged or corrupt files, as well as incompatibility issues between various elements.
How to fix error 10 The environment is incorrect
The troubleshooting steps required to fix error 10 vary quite a lot, depending on the tool affected by this error code. In this article, we’re going to offer you a series of specific solutions to fix the bad environment error.
But before we dive into specific troubleshooting methods, there are three general solutions that you can use: run a full system scan, repair your registry and update your OS.
If the issue still persists after following these general steps, continue the troubleshooting process with the specific methods.
Solution 1 — Run a full system scan
Malware may cause various issues on your computer, including errors. Perform a full system scan in order to detect any malware running on your computer. You can use Windows’ built-in antivirus, Windows Defender, or third-party antivirus solutions.
Solution 2 — Repair your registry
The simplest way to repair your registry is to use a dedicated tool, such as CCleaner. Don’t forget to first backup your registry in case anything goes wrong. If you haven’t installed any registry cleaner on your computer, check out our article on the best registry cleaners to use on Windows 10 PCs.
You can also use Microsoft’s System File Checker to check for system file corruption. However, this utility is only available on Windows 10. Here’s how to run an SFC scan:
1. Go to Start > type cmd > right-click Command Prompt > select Run as Administrator
2. Now type the sfc /scannow command
3. Wait for the scanning process to complete and then restart your computer. All corrupted files will be replaced on reboot.
Solution 3 — Update your OS
Make sure that you’re running the latest Windows OS updates on your machine. As a quick reminder, Microsoft constantly rolls out Windows updates in order to improve the system’s stability and fix various issues.
Go to Windows Update, check for updates and install the available updates. To access the Windows Update section, you can simply type “update” in the search box. This method works on all Windows versions.
If you’re looking for a particular update, go to Microsoft’s Update Catalog website. Simply type the KB number of the respective update, hit Enter and then click on the download button.
The environment is incorrect [Printer fix]
Solution 1 — Run the Printer Troubleshooter
Windows 10 features a built-in print troubleshooter that may come in handy if you encountered ‘The environment is incorrect’ error. To launch it, press Win + R and enter ‘msdt.exe /id PrinterDiagnostic‘. In the new window, select the Advanced button, click Print and hit Next. The troubleshooter will then scan your system in order to detect and fix any print-related issues.
Solution 2 — Update your PC drivers
Outdated drivers may also trigger bad environment errors. As a result, install the latest driver updates on your PC and see if this action solves the problem. Here’s how to update computer drivers for various Windows versions.
How to update drivers on Windows 10
You can fix the most common driver issues by installing the latest Windows updates. Simply type “update” in the Search box, and click Check for Updates to download and install the latest updates.
If you want to install particular drivers, launch Device Manager. Expand the available categories and select the device that you wish to update the driver for. To install the latest driver updates for that device, right-click on it and select Update Driver.
A third option is to download the available driver updates directly from the manufacturer’s website.
How to update drivers on Windows 7
You can set Windows 7 to automatically install the latest driver updates on your computer.
- Go to Start > click Devices and Printers.
- Right-click the name of your computer > select Device installation settings.
- Click Yes, do this automatically (recommended), and then click Save changes. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.
Solution 3 — Clear the spooler files and restart the spooler service
1. In the search box, type Services > select the first result.
2. In the Services list, double-click Print Spooler > select Stop > OK.
3. In the search box, type
%WINDIR%\system32\spool\printers > select the file folder >then delete all files in the folder.
4. Open Services again > double-click Print Spooler
5. Select Start, and in the Startup Type list, select the Automatic option > hit OK.
Solution 4 — Make sure that the same printer is not installed twice
Some users confirmed that ‘The environment is incorrect’ occurs if they install the same printer twice. If you have duplicate printers, open the print queue and cancel the jobs in the queue and then delete the extra printer.
READ ALSO: “Printer not responding”in Windows 10 [fix]
‘The environment is incorrect’ when copying files
Solution 1 — Remove recently installed software
If you recently installed new software on your computer, try uninstalling it. Go to Start > type Control Panel > select the program(s) recently added > click Uninstall.
Then restart your computer, and copy the files again.
Solution 2 — Check your disk for errors
On Windows 10, you can run a disk check using Command Prompt.
Start Command Prompt as administrator and type the chkdsk C: /f command followed by the Enter key. Replace C with the letter of your hard drive partition.
On Windows 7, go to hard drives > right-click the drive that you want to check > select Properties > Tool
Under the ‘Error checking’ section, click Check.
Solution 3 — Clean your temporary files and folders
The simplest and quickest manner to delete your temporary files and folders is to use Disk Cleanup. As you use your computer or browse the Internet, your PC accumulates various unnecessary files.
These so-called junk files may affect your computer’s processing speed, causing apps to respond slowly and may also trigger various error codes, including the ‘ERROR_FILE_NOT_FOUND’ error code
Here’s how to use Disk Cleanup on Windows 10:
1. Go to Start > type Disk Cleanup > launch the tool
2. Select the disk that you want to clean > the tool will them tell you how much space you can free up
3. Select “Clean up system files”.
Here’s how to use Disk Cleanup on Windows 7:
- Go to Start > type Disk Cleanup > open Disk Cleanup.
- In Disk Cleanup’s description section, select Clean up system files and select the drive that you want to clean up > click OK.
- On the Disk Cleanup tab, select the checkboxes for the file types that you want to delete > click OK > select Delete files.
The environment is Incorrect error when running an executable
Windows users sometimes get ‘The environment is incorrect’ error when trying to launch an executable file. This problem affects mainly Windows 10 apps and programs.
If the issue still persists after performing the three general troubleshooting steps listed at the beginning of this article, continue with the following troubleshooting solutions.
Solution 1 — Remove recently installed software
If this error occurs after you installed new software on your computer, try uninstalling it. Go to Start > type Control Panel > select the program(s) recently added > click Uninstall.
Then restart your computer, and try running that executable file again. Sometimes, various apps may cause incompatibility issues and prevent you from launching Windows apps and programs.
Solution 2 – Change your registry
For some unknown reason, the values in your registry can be changed from the default, preventing you from running .exe files. To fix this problem, follow these steps:
- Press Windows Key + X to open the Win + X menu and select Command Prompt (Admin) from the menu.
- When Command Prompt starts, enter regedit and press Enter.
- In the left pane, go to HKEY_CLASSES_ROOT.exe.
- In the right pane, double click (Default) key > set Data value to exefile.
- Now go to the
HKEY_CLASSES_ROOT\exefile\shell\open\commandkey in the left pane.
- In the right pane, select (Default), double click it and set its Value data to “%1” %*.
- Restart your computer and check if the problem is resolved.
Solution 3 – Change the location of Program Files folder to default
Program Files is a default installation directory for all third-party applications located on your System drive along with the Windows 10 installation. Changing the location of this folder may sometimes cause various issues and prevent you from opening .exe files. To fix this, change the location of the Program Files folder in the Registry Editor. Here’s how to do this:
- Hold the Shift key on your keyboard and click the Restart button.
- Go to Troubleshoot > Advanced options > Startup settings > click on Restart button.
- When your computer restarts, a list of options will appear. Select any version of Safe Mode by pressing the appropriate key.
- Open the Registry Editor. Press Windows Key + R and enter regedit. Press Enter or click OK.
- Go to the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersionkey in the left pane.
- Click on ProgramFilesDir and change its Value data to
C:\Program Files. If you have the ProgramFilesDir (x86) entry available, change its Value data to
C:\Program Files (x86).
- Close Registry Editor and restart your PC.
If ‘The environment is incorrect’ error is still preventing you from opening .exe files, you may also want to check our dedicated article on how to fix executable files not opening.
We hope that the solutions listed above helped you to fix ‘The environment is incorrect’ error code. If you’ve come across other workarounds to fix this problem, you can help the Windows community by listing the troubleshooting steps in the comments below.
Editor’s Note: This post was originally published in September 2017 and has been since completely revamped and updated for freshness, accuracy, and comprehensiveness.
RELATED STORIES YOU NEED TO CHECK OUT: