Fix: Cannot Create a File When That File Already Exists

Several users are reportedly getting the “Cannot create a file when that file already exists” error when trying to change the status of the Smart Card (SCardSVR) service from Disabled to a different state. The issue is reported to occur with multiple Windows versions including Windows 7, Windows 8.1 and Windows 10.

Cannot create a file when that file already exists

What is causing the “Cannot create a file when that file already exists” error?

We investigated this particular issue by looking at various user reports and at the most popular repair strategies that are commonly used to fix this particular problem.

As it turns out, this particular issue occurs due to a common Windows glitch that is confirmed to happen on Windows 8.1 and Windows 10. Microsoft has already released a fix for this particular glitch, but some users claim that the “Cannot create a file when that file already exists” error is still occurring even after they installed the Microsoft-provided hotfix.

If you’re struggling to resolve this particular issue, this article will provide you with several troubleshooting guides. Below you have three different methods that other users in a similar situation have used to get the issue resolved.

If you want to be as efficient as possible, follow the methods below in the order that they are presented. One of them is bound to help you fix or circumvent the “Cannot create a file when that file already exists” error.

Method 1: Installing the KB4057144 update (Windows 10 only)

If you’re encountering the issue on Windows 10, you have one simple fix that will allow you to resolve the issue with minimal hassle.  Microsoft has addressed this particular issue with a hotfix update that was released at the on January 2018.

The KB4057144 update addressed the issue where attempting to change the status of the Smart Card Windows service will trigger the “Cannot create a file when that file already exists” error.

If you’re in the habit of keeping your system update, you’ll most likely have this already installed. But if you don’t, follow the instructions below to ensure that the KB4057144 update in installed on your computer:

  1. Press Windows key + R to open up a Run dialog box. Then, type ms-settings:windowsupdate and press Enter to open up the Windows Update tab inside the Settings app.
    Run dialog: ms-settings:windowsupdate
  2. Inside the Windows Update screen, click on Check for updates and install every available pending update.
    Installing every pending Windows update
  3. When prompted to restart, click the Restart now button to allow your OS to install the update. Once the next startup is complete, return to the same screen and continue with the installation of the pending update until you have none left.
    Restarting the computer to allow the OS to install the updates
  4. Once every pending update has been installed, access the Services screen again and see if you are now able to change the status of the Smart Card (SCardSVR) service.

If you’re still having the same issue or you’re encountering the issue with a different operating system, move down to the next method below.

Method 2: Changing the status of the Smart Card (SCardSvr) via Regedit

If the first method was not applicable to your scenario, you might be able to circumvent the issue completely by using the Registry Editor to modify the status of the Smart Card (SCardSvR). Several users in a similar situation have reported that the procedure below has helped them to change the status of the SCardSvR service without encountering the “Cannot create a file when that file already exists” error.

Here’s what you need to do:

  1. Press Windows key +R to open up a Run dialog box. Then, type “regedit” and press Enter to open up the Registry Editor. If prompted by the UAC (User Account Control) click Yes to grant administrative privileges.
    Accessing the Registry Editor via Run box
  2. Inside the Registry Editor, navigate to the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SCardSvr
    Navigating to the SCardSvr registry key

    Note: You can either navigate to this location manually or you can paste the address directly into the navigation bar.

  3. Once you arrive at the location, double-click on the Start value from the right-hand side. Next, change the Value data according to what state you want to set for the Startup type of the SCardSVR:
    Automatic – 2
    Manual – 3
    Disabled – 4

    Changing the Start value to the appropriate Value Data
  4. Click OK to save the changes, then close Registry Editor and restart your computer. Once the next startup is complete, the Startup Type of Smart Card (SCardSVR) service should be already changed.

If you’re still having the having the same issue or you’re looking for a different approach, move down to the next method below.

Method 3: Changing the status of the Smart Card (SCardSvr) via Command Prompt

If the two methods above didn’t allow you to resolve the “Cannot create a file when that file already exists” error, let’s see if a series of CMD commands will. In some cases, this issue is confirmed to be resolved by changing the Startup type of the Smart Card (SCardSVR) service directly from an elevated Command Prompt window.

Here’s what you need to do:

  1. Press Windows key + R to open up a Run dialog box. Then, type “cmd” and press Ctrl + Shift + Enter to open up an elevated Command Prompt. When prompted by the UAC (User Account Control), click Yes to grant administrative privileges.
    Running CMD as an admin
  2. Once you arrive inside the elevated Command Prompt, type the following command to stop the Smart Card service:
    net stop SCardSvr
  3. Once the service has been stopped, use one of the following commands to change the Startup type of the service to the state that you want:
    Automatic:
    REG add "HKLM\SYSTEM\CurrentControlSet\services\SCardSvr" /v Start /t REG_DWORD /d 2 /f
    Manual:
    REG add "HKLM\SYSTEM\CurrentControlSet\services\SCardSvr" /v Start /t REG_DWORD /d 3 /f
    Disabled:
    REG add "HKLM\SYSTEM\CurrentControlSet\services\SCardSvr" /v Start /t REG_DWORD /d 4 /f
    Automatic (Delayed Start):
    REG add "HKLM\SYSTEM\CurrentControlSet\services\SCardSvr" /v Start /t REG_DWORD /d 2 /f
  4. Once the Startup Type has been changed, type the following command to restart the Smart Card service:
    net start SCardSvr
ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.