Hi,
You can call robocopy in the powershell script like this.
$src = "\\server\share\"
$dest = "\\server\Users\"
do { $naam = Read-Host -Prompt "Please enter user logon name" }
while(-not $naam)
robocopy (Join-Path $src $naam) (Join-Path $dest $naam) /E
Make sure you have full control permission to the $dest if you want to remove the $naam directory.
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.