Windows Error Code 126

Home ยป Tips ยป Windows Error Code 126

How to Fix Windows Error 126

The 126 error Code is usually related to some issues with the configuration of the system files in Windows operating systems. It may be caused by the damage of some system files and entries, which, in turn, may lead to instability of the entire OS. An incomplete installation of software, incomplete uninstallation of different applications, improper deletion of data or force shutdown of the computer, may all result in the occurrence of the 126 error Code. In some cases, the error may appear if your computer is recovered from a virus attack where the deletion or the corruption of entries in the windows registry may lead to missing and wrongly linked files, which are needed for the proper operation of the PC. If you are recently facing the error 126 Code on your computer, then, on this page, you will find a helpful list of instructions, which could help you to troubleshoot the problem on Windows Windows 8.1/ 8, 7 and Vista operating systems.

Fixes to error 126 Code for Windows 8/8.1, 7 & Vista

Fix 1: Reinstall iTunes and other problematic applications on your computer

If error 126 Code appears when you are trying to use iTunes, other Apple products or different applications that you have installed on your PC, it means that there is something wrong with the system, the program files may be missing or corrupted and, in that case, you may need to reinstall the software products to get rid of the problem.

Reinstall programs in Windows 8.1/ 8:

  1. Press Windows Key + X and then click on โ€œPrograms and Featuresโ€.
  2. Right click a program that you would like to uninstall and choose the โ€œUninstallโ€ option.ย 

It is advisable to first try to uninstall the following programs and see if the problem is fixed: Apple Application Support, Apple Mobile Device Support, Apple Software Update, Bonjour, iCloud, iTunes, MobileMe

  1. Next, restart your machine.
  2. Select My Computer desktop shortcut and manually remove the following folders:

C:\Program Files\Bonjour

C:\Program Files\Common Files\Apple

C:\Program Files\iPod

C:\Program Files\iTunes

  1. Download new setup of iTunes from the official website and install it on your computer.

Reinstall programs in earlier versions of Windows:

  1. Click the Start menu and select the Control Panelย 
  2. select Programs>Uninstall a Program
  3. Repeat the steps from 2 to 5 from the Reinstall programs in Windows 8.1/ 8 paragraph.

Fix 2: Modify the system variables as shown below:

For Windows 8.1/ 8 and Earlier Versions:

  1. Right click on My Computer desktop shortcut.
  2. Select Properties and click on the โ€œAdvanced system settingsโ€ link (displayed on left side panel).
  3. A System Properties dialog box will appear with Advanced tab opened as default.
  4. Click the โ€œEnvironment Variablesโ€ button and select โ€œSystem Variablesโ€.
  5. There, youโ€™ll find โ€œPathโ€ in the โ€œVariableโ€ variable. Select it and click the Edit button.
  6. You may find some value specified in โ€œVariable Valueโ€ textbox. Do not replace it. Just type a semi colon (;) at the end of the existing value and the new path specified: ย  ย  ย 6.a) In case โ€œVariable Valueโ€ textbox is empty, type below command:ย 

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\wbem ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย  ย 6.b) In case โ€œVariable Valueโ€ textbox is filled with some paths, type below command:ย 

;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\wbem

  1. Click OK and reboot the computer.

Fix 3: Set Windows Defender to run Automatically

In case that the startup type of Windows Defender has been changed, youโ€™ll have to reset it to โ€œAutomaticโ€ in order to fix error 126 Code.ย 

This is how to do that for Windows 8.1/ 8 and Earlier Versions:

  1. Press Windows Key + R
  2. Type โ€œServices.mscโ€ and click โ€œOKโ€
  3. Scroll down, locate and right click โ€œWindows Defenderโ€ and select โ€œPropertiesโ€
  4. Under โ€œGeneralโ€ tab and โ€œStartup Typeโ€ drop down box select โ€œAutomaticโ€ option
  5. Click on โ€œApplyโ€, and then โ€œOK:

Fix 4: Delete Repository Folder

Error 126 may occur when the files in the Repository folder are corrupted. To use this fix, first, stop Windows Management Instrumentation service and then delete this folder. It is very important to stop the service before proceeding since it uses the Repository Folder.

For Windows 8.1/ 8 and Earlier Versions:

  1. 1.Press Windows Key+ R
  2. Type โ€œServices.mscโ€ and click โ€œOKโ€
  3. Right click โ€œWindows Management Instrumentationโ€ service and select โ€œStopโ€
  4. Close the tool and then select the My Computer desktop icon
  5. Browse the following folder: C:\Windows\System32\Wbem
  6. Delete โ€œRepositoryโ€ folder and restart your PC

Fix 5: Copy Missing File from the Installation Disc

Error 126 Code may appear when โ€œsrvsvc.dllโ€ file is missing. This file is located in the i386 folder in Windows installation disc. The same file is copied to your hard disk during Windows installation. To fix the problem, copy the file again to your hard disk with Command Prompt and place it in the correct directory.

Here is how to do it for Windows 8.1/ 8:

  1. Insert Windows 8.1/ 8 installation disc
  2. Press the Windows Key + X and click โ€œCommand Prompt (Admin)โ€
  3. Type the following command:

expand X:\i386\srvsvc.dl_ C:\Windows\system32\srvsvc.dll

(In above command, replace โ€œXโ€ with the appropriate DVD Drive letter)

  1. Press ENTER

For Earlier Versions of Windows:

  1. Click the Start menu, hover your mouse at All Programs | Accessoriesย 
  2. Right click Command Prompt, choose Run as Administrator
  3. Type the following command:

expand X:\i386\srvsvc.dl_ C:\Windows\system32\srvsvc.dll

(In above command, replace โ€œXโ€ with the appropriate DVD Drive letter)

  1. Press ENTER

Fix 6: Repair the WinSock with the command given below.

For Windows 8.1/ 8 and Earlier Versions:

  1. Open Command Prompt as mentioned in โ€œCopy missing file from installation discโ€ paragraph
  2. Type the following commands:

netsh winsock reset

netsh advfirewall reset

ย  ย  ย  ย 3. When youโ€™re done with the execution of these commands, reboot your computer.

Fix 7: Reregister DLL File

The 126 error Code may also signify that the DLL file registration entries can be corrupt. Unregister and reregister the DLL file as shown below to fix the issue:

For Windows 8.1/ 8 and Earlier Versions:

  1. Open Command Prompt as mentioned in โ€œCopy missing file from installation discโ€ paragraph
  2. Type the following command- RegSvr32.exe MSSTDFMT.DLL
  3. Press ENTER.

Leave a Reply

Your email address will not be published. Required fields are marked *


Is Your PC Secure?

Protect your PC & prevent malware with SpyHunter (Try Free For 7 Days*)

Download SpyHunter Now
(Windows)