How to Copy Files That Are Open in Newer Windows OS Environment

How to Copy Files That Are Open in Newer Windows OS Environment

Release Date: 06/12/2025
Version: N/A

In the older Windows operating systems, like Windows 2008 or 2012, we often use the Windows command prompt to COPY and XCOPY for backup and creating/ testing Elliott database purposes.  We can do so even though some of the Elliott database files are still opened by the PSQL (ZEN) database engine.

Starting with Windows 2016, 2019, and beyond, you may experience a "sharing violation" when trying to copy those open files. This is a common limitation with file copying on shared volumes or mapped drives with a newer Windows OS. These versions have stricter file locking, security policies, and improved concurrency management, which can prevent you from copying files that are in use or opened by others.

To overcome this issue effectively.  You can use the Windows Shadow Copy (VSS) to Copy In-Use Files.
Step 1 - You must make sure you are an Administrator or an Administrator-equivalent user on the server where the files reside.
Step 2 - Bring up a CMD prompt, and type DISKSHADOW. The User Security Elevation window may show up and you need to confirm "Yes" to allow DiskShadow app to proceed.
Step 3 - The DiskShadow shell window will show up.  Please type the following in the shell:
      SET CONTEXT PERSISTENT NOWRITERS
      ADD VOLUME D: ALIAS MyShadow
      CREATE
      EXPOSE %MyShadow% X:
  1. Note the D: is the volume on the server you want to copy from to create the Shadow Copy.  
  2. You cannot use a mapped drive letter or UNC path to create the Shadow Copy.
  3. The CREATE step can take a significant amount of time (minutes) depending on the size of your volume.
See sample screen below:

Step 4 - Bring up another CMD prompt to run in "Administrator" mode.  Use COPY, XCOPY to copy from the X: drive instead of D: drive to the destination.
Step 5 - After successfully copying the files, in the DiskShadow shell, type the following command:
      DELETE SHADOWS ALL

Clean up
Please be aware of the following:
  1. You must manually delete the shadow copy to ensure it's properly removed and system resources are freed.
  2. If you just exit DiskShadow, it does not delete persistent shadow copies.

EMK

    • Related Articles

    • Fail to Copy Elliott to Local Path & Create Desktop Icon

      Release Date: 09/12/2024 Version: 8.5 & Up Q - One user is running Elliott 8.5 right now. I tried to upgrade this workstation to Elliott 8.6. So I navigated to the <ElliottRoot>\Bin86 folder and execute EL860.EXE. I received the following message: ...
    • Feature - Minimize Open Files by Elliott Defer Processing

      Release Date: 7/14/2023 Version: 8.63.714 & Up Background The primary purpose of this enhancement is allow XCOPY to back up Elliott's data. Some users may choose to accomplish this by using XCOPY at nighttime through Task Scheduler. See below: The ...
    • Error Connecting VPN from Windows 10 to Windows 2008 Server

      Q - I recently upgraded my machine to Windows 10. When I tried to connect VPN to my office VPN server, which resides on a Windows 2008 server, it does not work. I receive the following error message: The remote connection was denied because the user ...
    • Does Elliott Support Windows 10?

      Q - Does Elliott support Windows 10? A - With the latest Elliott version, we do support Windows OS 10. We suggest that you first update to the latest relevant Elliott version. There are a few issues you should pay attention to when upgrading to ...
    • Feature - Add Amigo Support to Additional Transactional Files

      Added Amigo support for specific transactional files in AP, AR, and Payroll packages. In AR: 1) Changes were made to Cash Receipts processing, Add and Change functions, to only enable the Amigos once the user is entering the apply-to number. ...