skip to Main Content

I had VS Code on my Windows laptop, but it wasn’t launching. I tried uninstalling it and reinstalling it, but I kept receiving this error message: "An error occured while trying to replace the existing file: DeleteFile failed; code 5. Access is denied". Does anyone know how to resolve it? I’m using a .exe file to set it up.

I tried uninstalling it and reinstalling, but it gave the same error message. I’ve also deleted all the VS Code related files I could find.

2

Answers


  1. Googling "github vscode issues "An error occurred while trying to replace the existing file" "DeleteFile failed" "code 5"", I found the following:

    Login or Signup to reply.
  2. The error message you are encountering ("DeleteFile failed; code 5. Access is denied") suggests that the installer is unable to delete some existing files during the installation process. This might be due to permissions issues or other processes locking the files.

    Here are some steps you can try to resolve the issue:

    ->Run the installer as an administrator:
    Right-click on the VS Code .exe file and select "Run as administrator." This will give the installer the necessary permissions to modify files on your system.

    ->Check for running processes:
    Make sure that all instances of Visual Studio Code and related processes are closed before attempting the installation. Sometimes, background processes may keep files locked, preventing deletion during the installation.

    ->Use a different installer:
    If the .exe installer continues to fail, try using the .zip package instead. The .zip package allows you to install VS Code without using an installer and might bypass the issue with file deletion.

    ->Check your antivirus/firewall software:
    Some antivirus or firewall programs may interfere with the installation process. Temporarily disabling these security software or adding an exception for the VS Code installation may help.

    ->Clean up temporary files:
    Sometimes, temporary files left behind from previous installations can cause conflicts. Use the Disk Cleanup utility on Windows to remove temporary files and try reinstalling again.

    ->Use a third-party uninstaller tool:
    If you haven’t completely removed all VS Code related files, using a third-party uninstaller tool like "Revo Uninstaller" can help ensure a thorough removal before attempting a fresh installation.

    ->Check Windows permissions:
    Ensure that your user account has sufficient permissions to install software on your system. If you are using a managed computer, you may need to contact your system administrator for assistance.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search