Software⏱️ 2 min read📅 2026-06-11

How to Fix: mklink error: Cannot create a file when that file already exists

Error creating symbolic link due to existing file on Windows 7.

Quick Answer: Try using the /Y option with mklink, or consider running the command prompt as an administrator with elevated privileges.

The 'Cannot create a file when that file already exists' error occurs when you attempt to create a symbolic link (mklink) to a directory that already exists. This issue affects users trying to redirect files or folders to another drive using mklink commands in Windows 7 64-bit. The frustration comes from the fact that you've entered the correct syntax and are running the command in an elevated Administrator Command Window, yet still encounter this error. Fortunately, we can troubleshoot and resolve this issue by exploring the root causes and implementing a suitable fix.

⚠️ Common Causes

  • The primary reason for this error is that mklink attempts to create a new directory with the same name as an existing one, resulting in the 'file already exists' message. This occurs when you try to link a directory that already contains files or subdirectories. As an alternative explanation, it's also possible that there are group policies or other system-level restrictions preventing you from running this command.
  • Another potential cause could be that the target directory is not empty, containing files or subdirectories that cannot be deleted or moved due to permissions issues or other constraints.

🔧 Proven Troubleshooting Steps

Resolving the error by checking and deleting existing contents

  1. Step 1: Open a File Explorer window and navigate to the target directory ('E:\

Alternative Advanced Fix

    🎯 Final Words

    Did this fix your problem?

    If not, try searching for specific error codes.

    🔍 Search Error Database

    ❓ Frequently Asked Questions