XCOPY very slow to start when connected to VPN

Josh K 81 Reputation points
2021-02-05T19:01:56.207+00:00

Laptop is Win 10. I have a .cmd script that uses XCOPY to back my files up. Backup is from my local drive to a USB flash drive. Backup runs just fine unless I'm connected to my work network via VPN, in which case it can take as long as 30 minutes for the script to begin copying files once executed. I've tried unmapping network drives and that did not change anything. I'm only backing up local files, so I don't know what the VPN connection could have to do with anything. Any thoughts or suggestions are appreciated.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,565 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,266 questions
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 31,561 Reputation points
    2021-02-08T18:10:24.86+00:00

    If you have tons of files in Documents, then yes it may take some time to build the directory list.

    Since you are using /d, are you just trying to mirror Documents to a backup folder? If so, try robocopy.exe with the /e switch. Or use /mir (mirror) if you want it to delete files too. The /l switch will run an analysis without doing any copy/deleete.

    Robocopy will also give you a more detailed report of what it did.

    1 person found this answer helpful.

7 additional answers

Sort by: Most helpful
  1. MotoX80 31,561 Reputation points
    2021-02-05T19:37:27.91+00:00

    Use Process Monitor to trace the activity of xcopy.exe.

    https://learn.microsoft.com/en-us/sysinternals/downloads/procmon

    https://www.bing.com/search?q=how+to+use+process+monitor

    Start by setting a filter for "Process name is xcopy.exe". Start the trace and kick off the xcopy. The trace will show all file, registry and network calls that are made. See what entries get generated during the "dead time".

    Does robocopy act the same way?

    0 comments No comments

  2. Josh K 81 Reputation points
    2021-02-05T20:14:21.233+00:00

    Interesting - it's making a network call to a server for a "create file" operation. The server is inside my company but I wonder why a simple copy command would be doing that (?)

    0 comments No comments

  3. Josh K 81 Reputation points
    2021-02-05T20:22:21.303+00:00

    Question: - my script contains a number of XCOPY commands, since I need to back up files from several locations. Does Windows treat each command as a separate execution of XCOPY or does it parse the entire script before executing?


  4. Josh K 81 Reputation points
    2021-02-05T21:59:37.963+00:00

    This had no effect, unfortunately. I'm about to sign off for the day so let's pick this back up on Monday. Appreciate your suggestions!

    0 comments No comments