none
Copying Selected Files Over Network RRS feed

  • Question

  • Hi Guys.

    can someone please shed some light on this for me, as I am a newbie to Powershell. 

    I am hopeful that someone can provide me with a sample of a working script where I can copy .XML files from one PC to another over c$ command, if that is possible

    c:>Programdata>Progit..File01.xml

    and copy to 

    c:>Programdata>Progit..File01.xml (NewMachine)

    Its sounds really straight forward but I am struggling to start.

    Friday, August 4, 2017 7:47 PM

Answers

  • Hi B8oxing 

    You can use copy-item below would copy from a local machine to a remote computer. 

    Copy-Item -Path "C:\ProgramData\progit\file01.xml" -Destination "\\Newcompuer\c$\ProgramData\progit\file01.xml"

    If you want to copy from a remote comptuer to another remote computer you could use

    Copy-Item -Path "\\Comp1\c$\ProgramData\progit\file01.xml" -Destination "\\Comp2\c$\ProgramData\progit\file01.xml"
    

    Sunday, August 6, 2017 10:57 AM

All replies

  • What does your question have to do with PowerShell?

    Are you familiar with using any kind of command line? If not, I recommend using the Windows Explorer GUI to copy files.


    -- Bill Stewart [Bill_Stewart]

    Friday, August 4, 2017 8:09 PM
    Moderator
  • help Copy-Item -full

    Just use the copy command.

    "c$" is not a command; it is an Admin share.


    \_(ツ)_/

    Friday, August 4, 2017 8:43 PM
  • Hi B8oxing 

    You can use copy-item below would copy from a local machine to a remote computer. 

    Copy-Item -Path "C:\ProgramData\progit\file01.xml" -Destination "\\Newcompuer\c$\ProgramData\progit\file01.xml"

    If you want to copy from a remote comptuer to another remote computer you could use

    Copy-Item -Path "\\Comp1\c$\ProgramData\progit\file01.xml" -Destination "\\Comp2\c$\ProgramData\progit\file01.xml"
    

    Sunday, August 6, 2017 10:57 AM