Can't copy folders

//Can't copy folders
Can't copy folders 2017-04-27T12:11:20+00:00

The Toolkit Forums General Can't copy folders

  • Author
    Posts
  • Richard
    Participant
    Post count: 4
    #2115 |

    Sorry for the basic question but I’m stumped. Everything else is working but I can’t get the script to copy a folder.

    Originally I had it doing something more complicated but for now I’m just trying the very basic.

    Copy-File -Path “$dirSupportFiles\*.*” -Destination “C:\Apps” -recurse

    in my SupportFiles directory I have a folder called “Avaya” and a document called “batman.txt”. Only “batman.txt” gets copied over.

  • Richard
    Participant
    Post count: 4

    So I ended up abandoning Copy-File and instead just used Copy-Item.

    <code>       
    $User = $($CurrentLoggedOnUserSession.Username)
    Copy-Item &quot;$dirSupportFiles\*&quot; &quot;C:\Users\$User\Appdata\Roaming&quot; -Recurse
    </code>
  • Darren
    Participant
    Post count: 1

    Was doing some searching and found this post. I have the same problems. At the same time the copy to $evnCommonPrograms was dumping to the root of C for some reason as well.

  • Jim
    Participant
    Post count: 43

    Here’s what I did. The folder name is ‘Home Care Access’ and gets copied to the Public Desktop:

    Copy-File -Path "$dirFiles\Desktop Folders\Home Care Access" -Destination $envCommonDesktop -Recurse

You must be logged in to reply to this topic.