locked
Copying and pasting files from Win 7 to XP via Cmd Prompt RRS feed

  • Question

  • Hello

    I have managed to network a Win 7 PC and an XP PC (both wireless and using the same home router).

    I aim to copy and paste all those files I have worked on over the last 24 hours from my Win 7 PC to my XP PC and this is the script I have to do it:

    dir c:\data -r | ? {!($_.psiscontainer) -AND $_.lastwritetime -gt (get-date).date} |

    % {Copy-Item -path $_.fullname -destination \\hyperv1\shared\backup}

    I presume that I type that in in Command Prompt on a daily basis, but how would I best customise the script, please?

    Let's say, for example, I have a file called WebSite10 (created in Visual Studio) that resides here:

    C:\Users\Steve\Documents\Visual Studio\Website10

    on my Win 7 PC and I wish to copy and paste it to the Shared Documents folder on my XP PC.

    Thanks for any advice.

    Bluenose

    Sunday, September 7, 2014 12:45 PM

Answers

  • You don't need a script, I don't think. Just use the robocopy command.


    -- Bill Stewart [Bill_Stewart]

    • Proposed as answer by Mike Laughlin Monday, September 8, 2014 2:03 PM
    • Marked as answer by Bill_Stewart Monday, November 10, 2014 5:57 PM
    Sunday, September 7, 2014 1:19 PM

All replies

  • You don't need a script, I don't think. Just use the robocopy command.


    -- Bill Stewart [Bill_Stewart]

    • Proposed as answer by Mike Laughlin Monday, September 8, 2014 2:03 PM
    • Marked as answer by Bill_Stewart Monday, November 10, 2014 5:57 PM
    Sunday, September 7, 2014 1:19 PM
  • I'm with Bill here but I'm guessing that you want to backup your project on a daily basis.

    I suggest Visual Studio Team Foundation Server Express to backup your data with the added bonus of version control.

    I used to use it for all my scripting but now use Subversion as there's a server built into my NAS.


    Blog: http://scriptimus.wordpress.com

    Wednesday, October 1, 2014 9:00 PM