PowerShell like Robocopy

SourSnacks 101 Reputation points
2021-06-24T18:38:26.293+00:00

Hello All -

Trying to locally copy all folders a files which is approximately 141GB within a specific directory to a network file share. I was initially trying to use Robocopy, however I'm doing something wrong since I'm receiving "Error : No Destination Directory Specified". I know this is not correct since I created the share and can manually copy/paste folders and files to and from without issue. I tried another PowerShell script that I'm using for backups to the same share, which works, but the script is far to granular for what I'm wanting to do for this. Basically I'd like to use PowerShell to perform the same function as Robocopy command I'm using similarly below.

Example:

"robocopy c:\source\test-folder1 \destination\test-folder2 /e"

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Leon Laude 86,026 Reputation points
    2021-06-24T18:55:09.513+00:00

    Hi @SourSnacks ,

    The equivalent of your robocopy script in PowerShell would be something as follows:

    Copy-Item -Path "C:\source\test-folder1\*" -Destination \\destination\test-folder2  
    

    The robocopy command you've posted seems correct and works for me, you could try placing double quotes around your source and destination:

    robocopy "c:\source\test-folder1" "\\destination\test-folder2" /E  
    

    ----------

    If the reply was helpful please don't forget to upvote and/or accept as answer, thank you!

    Best regards,
    Leon

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.