Windows users are no longer strangers to errors and glitches.

But some error messages, like Runtime Error 339, still find a way to catch them off guard and disrupt important activity.

Runtime errors are relatively common on Windows computers, especially those used for a long time.

While they may seem like tough nuts to crack, they’re generally easier to troubleshoot than other errors.

Understanding the error code and its context can help you quickly identify the cause and resolve the issue.

This guide focuses on Runtime Error 339, its symptoms, causes, and most effective solutions.


Related: [FIXED] Programs Keep Not Responding in Windows 10


What is Runtime Error 339?

Runtime errors are glitches that happen to running applications. The term “runtime error” indicates that the error occurs after the user launches the program.

These errors typically manifest as crashes, freezes, error messages, or unusual behavior within the program.

Runtime error 339 explicitly occurs when Windows cannot access the Dynamic Link Library (.dll) or Object Linking and Embedding Control Extension, or OLE Control Extension (.ocx), file it needs to run a program or instances of it.

This issue happens because the file is missing, corrupt, or not appropriately registered.

The error dialog almost always displays the name of the file that the OS cannot access.

Below is an example of a runtime 339 error:

Run-time error ‘339’:

Component ‘wshom.ocx’ or one of its dependencies not correctly registered: a file is missing or invalid.”

In this case, the file that Windows can’t use is “wshom.ocx.”

What Causes Runtime Error 339

As mentioned earlier, the primary cause of the error is Windows’ inability to access a file required to run a program or instance of a program.

That said, there are different reasons why Windows cannot access the said file.

  • Missing file. The file in question may be missing because it was accidentally deleted, moved, or replaced.
  • Corrupted file. Windows may show Run Time eError 339 because the file it needs to run the program has been damaged due to malware infection, improper shutdown, or a malfunctioning storage device.

Also Read: How to Find and Fix Corrupted Files in Windows 10?


  • Unregistered files. Files need to be registered with Windows to be recognized and used properly. So, the OCX or DLL file may exist on your computer but may not be registered.
  • Software bugs. Sometimes, errors during application installation can leave missing or corrupted files, leading to Rruntime error 339.

Helpful Read: Why Is My Computer Glitching? The Most Common Reasons for Computer Glitches


  • Lack of permission. In some cases, the application in question may not have the required security clearance to access the DLL or OCX file, causing Windows to throw up the error message.

Also Read: [FIXED] “You Need Permission to Perform This Action” Issue in Windows


How to Fix Runtime Error 339 in Windows 10

While Runtime error 339 can manifest itself on machines running any modern version of Windows (Windows XP, Windows Vista, Windows 7, Windows 8 or 8.1, and Windows 10), we intend to use Windows 10 as the base point or reference OS for our fixes.

We will describe the procedures or operations used to resolve Runtime error 339 on a Windows 10 PC.

Still, users with devices running older versions can use and apply the same solutions.

Ideally, you should begin with the first fix on the list. If it fails, you will have to work through the other solutions in the order they are arranged below.

Fix 1: Run the application as an administrator

As mentioned earlier, the file may exist, but the program you want to run may lack permission to access it.

You can grant the program the required permissions by running it as an administrator.


Also Read: [FIXED] You need to sign in as an administrator to continue


To do that, open the Start menu, search for the application, right-click it, and then select Run as administrator.

If running the program as an administrator resolves the problem, you can set it to always run as an administrator instead of right-clicking it whenever you want to launch it.

Follow these steps if you did not install the app through the Microsoft Store:

  • Launch the Start menu and type the program’s name.
  • Right-click the app when it appears in the search results and select Open file location.
  • Next, right-click the shortcut and click Properties.
  • Go to the Compatibility tab immediately after the Properties dialog opens, select the Run this program as an administrator checkbox, and click OK.
Acrobat properties

Follow these steps if you installed the program through the Microsoft Store:

  • Launch a File Explorer window and go to the following location:

C:\Program Files\WindowsApps\

Program files Windows apps
  • If you cannot see the WindowsApps folder, it is likely hidden. So, go to the View tab in the ribbon menu and check the box next to Hidden items.
  • Now, open the WindowsApps folder, and then open the app’s folder. The folder names are tricky because they contain numerous characters, and each app may have multiple folders.
  • Open the app’s folder that contains “x64” and locate the EXE file. For example, below is the folder that contains the Apple iTunes EXE file:
  • Right-click the EXE file and select Properties.
  • Now, go to the Compatibility tab, select Run this program as an administrator, and click the OK button.

Note: We advise that you only grant administrative rights to trusted third-party programs. Suppose you give admin powers to a malicious or harmful app.

In that case, the application might wreak havoc on your computer – and your antivirus or protection utilities might struggle to restrict or disrupt its operations.

Precautions are advised here.

Fix 2: Register the problematic OCX or DLL file

The next fix involves ensuring that the file mentioned in the Runtime error 339 dialog is properly registered.

In this case, you have to deregister and reregister the OCX or DLL file.

These steps will show you how to do that:

  • Go to the Start menu and type CMD.
  • Right-click Command Prompt immediately after it appears in the search results and select Run as administrator.
  • Click Yes in the UAC pop-up.
  • Type the command below and hit the Enter keyboard button after Command Prompt appears:
regsvr32 /u filename

Ensure you replace filename with the name of the DLL or OCX file you want to deregister. So, the command should look like this:

regsvr32 /u wshom.ocx
  • Next, type the following command to reregister the file:
regsvr32 filename

You can now check to confirm whether the error has been resolved.

Download Auslogics Registry Cleaner
The program will clean corrupt or outdated entries from the Windows registry to resolve causes of various errors and malfunctions.

Also Read: Windows Command Prompt: 28 Most Useful CMD Commands [with Examples]


Fix 3: Get rid of malware

Malicious programs can corrupt or delete the DLL or OCX file appearing in the error as part of their nefarious activities.

Other fixes will not work if your computer is infected by malware and you don’t get rid of it.

You must run a full scan to find and remove the virus, as programs designed to attack such areas on your system are equipped with sophisticated maneuvers.

You should ensure your antivirus program is up to date before running the full malware scan.

These steps will show you how to get the latest virus definitions for Windows’ native security tool and how to run the full scan:

  • Launch the Windows Security app by clicking the shield in the system tray.
  • Select Virus & threat protection.
  • Scroll through the Virus & threat protection page and select Protection updates.
  • Click Check for updates on the next page to find and install available updates.
Protection Updates
  • Now, return to the previous page and select Scan options.
Protection Updates
  • Choose Full scan and click the Scan now button.
Protection Updates
  • The process may take a while, so be patient while it scans your entire PC to get rid of the malicious program.
  • But you’re not done. After the full scan is complete, return to the Scan options page, select Microsoft Defender Antivirus (offline scan), and click Scan now.
Protection Updates

This thorough and advanced scan attempts to detect hard-to-find malware programs designed to evade security applications.

You can check for the error after Windows Security finishes the scan.

If the problem persists, you just confirmed that you’re not a victim of malware activity. Move on to the next fix.


Related: Signs of Malware: How to Know if Your Computer is Infected


Fix 4: Get the missing or corrupted file from another computer

Replacing the DLL or OCX file in the error with a functioning replica from another computer is another way to eliminate the problem.

Note that you must copy the file to the correct folder and register it using the command we showed earlier.

First, you must confirm the file’s location to know where you’re replacing it.

Remember that the error will continue to appear if you copy the file to the wrong location.

Knowing the file’s location will also help you find it on the other computer.

That said, you can use the Windows search function on the computer to locate the file.

Follow these steps to deregister the file from your computer and copy a functioning version from another PC:

  • Open Command Prompt as an administrator and enter the following command to deregister the file:
regsvr32 /u filename

Remember to enter the correct file name.

  • Next, go to File Explorer, locate the file, and delete it.
  • Afterward, go to the computer with a functioning copy of the same file and transfer it to the correct folder on your system.
  • Your next step involves registering the file you just copied. Open Command Prompt as an administrator and register the file using the following command line:
regsvr32 filename
  • You can now try running the program to check if the error persists.

Fix 5: Reinstall the affected program

Reinstalling the application can reset specific registry entries and replace broken, missing, or corrupt files.

You can also reregister files correctly when you reinstall the program that displays the runtime error.

Now, follow these steps to reinstall the program:

  • Open the Start menu and type Control.
  • Click Control Panel.
  • Select Uninstall a program once the control panel window appears.
Protection Updates
  • Scroll through the list of programs, right-click the affected application, and select Uninstall.
Protection Updates
  • Confirm your decision to remove the program and allow Windows to complete the process.
  • Restart your computer.

Once your system reboots, download the app’s latest installation package and install it.


Also Read: How to Uninstall Programs on Windows 10/11?


Fix 6: Restore Windows to a previous working state

Making certain changes to your computer, such as installing and uninstalling applications, device drivers, and Windows updates can tamper with OCX and DLL files.

Restoring your computer to a date when the application ran without problems could help you reverse the problem for good.

You should note that you will likely only see a restore point if you have created one before or if Windows automatically created one after installing updates.

Follow these steps to restore your computer:

  • Go to the Start menu and type restore.
  • Click Create a restore point in the search results.
  • Click the System Restore button after the System Properties window appears.
Protection Updates
  • Click Next, select your restore point, and click the Next button.
Protection Updates

Check if Runtime error 339 shows up again after your system has been restored.

Fix 7: Use a registry cleaner

You’ve probably read that the OCX and DLL files must be registered before Windows can use them.

That registration process involves storing information about the file in the system registry.

From there, Windows consults the registry whenever it wants to locate and use the file.

If the registry becomes too fragmented or keys become corrupt or missing, Windows will fail to access the file. Using a registry cleaner can help.


Helpful Read: Ultimate Guide: How to Fix Broken Registry Items in Windows 10/11


PRO TIP
A registry cleaner will execute operations to remove the invalid, broken, and corrupted entries from your registry.

We advise you to download and run Auslogics Registry Cleaner . After the cleaning operation, you must restart your PC to finish things.


Get more info: What is the Windows Registry And Why Do You Need a Registry Cleaner?


Fix 8: Install important applications and components

There is a good chance you are struggling with Runtime error 339 because your computer is missing specific programs and components that other apps need to run or work.

Some users managed to fix the problems by checking for and installing older versions of DirectX and Visual C++ Redistributables.

Conclusion

Runtime error 339 shouldn’t disrupt your work or activity for too long, as the fixes above are proven and effective.

Ensure you always keep your PC protected against malware, as it’s one of the main causes of the error.

Do well to let us know your thoughts on these solutions by leaving a comment below.

You can share which method helped you resolve the issue or tell us if you have any other challenges.