none
Copy Paste Script RRS feed

  • Question

  • Hi, I need help trying to create a script to copy a file from a network harddrive onto the user's computer.

    The aim is to have the file get copied to the startup folder, and the file I am copying is a vbs file.

    Something like this:

    Copy from F://file location to C://user/desktop

    Run File

    Delete File

    I know robocopy is my friend i just cant get it to work correctly for some reason, any help will be appreactiated :)

    • Moved by Bill_Stewart Wednesday, February 14, 2018 7:43 PM Unanswerable drive-by question
    Wednesday, January 10, 2018 3:46 PM

All replies

  • Start a cmd.exe type "robocopy /?" and read the help. On top of that you could use your favorite internet search engine to find some of the thousands of examples how to copy a file from one point to another.

    Good luck and have a lot of fun!  ;-)


    Best regards,

    (79,108,97,102|%{[char]$_})-join''

    Wednesday, January 10, 2018 3:55 PM
  • This forum isn't really for scripting requests, it's for more specific coding questions. Give it a shot and we'll help debug :D

    Good place to start: 

    Copy-Item

    Remove-Item

    Sample of Invoke-VBScriptTake a look at those and try writing something up. We'll be happy to help you then!


    Jeremy Corbello | https://www.jeremycorbello.com

    Wednesday, January 10, 2018 3:56 PM
  • Thanks for your response!

    Ive tried loads of ways, hence why I am now here asking.

    Anyway I appeared to have sorted it for the most part. The script copies from one location and pastes to another, is there a command I can now use to make the file execute after being copied?

    Thanks

    Wednesday, January 10, 2018 4:12 PM
  • Take a look at PsExec:

    https://docs.microsoft.com/en-us/sysinternals/downloads/psexec


    Jeremy Corbello | https://www.jeremycorbello.com

    Wednesday, January 10, 2018 4:30 PM