1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Right click send to multiple drives/folders

Discussion in 'Windows & Other Software' started by Mcnumpty2323, 13 Jan 2020.

  1. Mcnumpty2323

    Mobster

    Joined: 21 Dec 2019

    Posts: 3,538

    I move a load of data around
    3 x M2 drives
    3 x sata ssds
    1 x external
    Have multiple back ups of stuff on them
    Any one know how to get a right click to send to multiple places at once?

    For example
    Send to D and E and F drive all at same time
    I know its only couple extra clicks to do them separately but gets irritating after a while
    Not looking for one of those automated backup softwares as it's on a file by file basis for example if i mount a backup image and want something off that etc

    Thanks
     
  2. Bouton Aide

    Caporegime

    Joined: 9 Aug 2008

    Posts: 26,150

    Make your own right click that runs a batch file.
     
  3. Mcnumpty2323

    Mobster

    Joined: 21 Dec 2019

    Posts: 3,538

    If knew how to wouldn't have asked in here lol
    Normally for a single shortcut I just go to shell:send to and do it
    But can't see a way to do what I want there
    Wouldn't a batch file mean running the batch file all the time?
     
  4. Bouton Aide

    Caporegime

    Joined: 9 Aug 2008

    Posts: 26,150

    A batch file can be ran whenever you like, doesn't have to be constant.

    Anyway try this, it's freeware.
    https://www.techspot.com/downloads/7095-easy-context-menu.html
     
  5. Mcnumpty2323

    Mobster

    Joined: 21 Dec 2019

    Posts: 3,538

    Thanks will have a look
    Tried some of the right click enhancing softwares but none did it
    Fingers crossed for that one
     
  6. Bouton Aide

    Caporegime

    Joined: 9 Aug 2008

    Posts: 26,150

    You just make your own. Make/program your batch file then make your right click menu. :)
     
  7. Django x2

    Capodecina

    Joined: 28 Sep 2008

    Posts: 13,252

    Location: Britain

    Create a symbolic link to all the drives then Robocopy from source to symbolic destination
     
  8. Mcnumpty2323

    Mobster

    Joined: 21 Dec 2019

    Posts: 3,538

    Read a bit on mklink
    Most examples I found explained how to do if for a specific folder buried in the operating system
    Not just a simple send to drives D, E, F
    Like I am looking for
    So left me none the wiser after an hours reading on it lol
     
  9. Django x2

    Capodecina

    Joined: 28 Sep 2008

    Posts: 13,252

    Location: Britain

    Got a nicer way to do this for you in PowerShell. I haven't tested it for efficiency or leakage as time is a bit short today, but this will work for you

    Code:
    $source = "C:\source"
    $destFolders = 'C:\wherever',  '\\server1\wherever', 'E:\somewhere_else'
    $destFolders | Foreach-Object { Copy-Item -Path $Source -dest (Join-Path $_ $destFileName) }
    
    
     
  10. Mcnumpty2323

    Mobster

    Joined: 21 Dec 2019

    Posts: 3,538

    Thank you very much
    I will try it once I am on pc
    And let you know how I get on
     
  11. Mcnumpty2323

    Mobster

    Joined: 21 Dec 2019

    Posts: 3,538

    so obviously i am not very good at this
    is the idea i make a source folder drop stuff in it
    and it should copy to destination folders?

    heres what i tried-i assumed i would have to alter some of what you wrote to fit my circumstances
    so made a source folder on drive c desktop-called sendtodrives -no spaces in name in case made it more complex
    made a destination folder on e,f,g drives--all called sentfromdrives-tried 1,2,3 on end of each in case all called the same even though on different drives might be a problem
    didnt work so removed 1,2,3 for now
    so its
    C:\Users\Administrator\Desktop\sendtodrives is source folder
    E:\sentfromdrives destination folders-wasnt sure if could just use root of destination drives hence a folder
    F:\sentfromdrives
    G:\sentfromdrives

    so tried
    $source = "C:\Users\Administrator\Desktop\sendtodrives"
    $destFolders = 'E:\sentfromdrives', '\\F:\sentfromdrives, 'G:\sentfromdrives'
    $destFolders | Foreach-Object { Copy-Item -Path $Source -dest (Join-Path $_ $destFileName) }

    i know probably made a mess of it never tried this before so thanks for your help and patience
     
  12. Django x2

    Capodecina

    Joined: 28 Sep 2008

    Posts: 13,252

    Location: Britain

    You did this in powershell?

    I suspect it's because the source is pointing to a folder and there's no recursive switch in the command so you'd want to tell PS what you're moving from the source. If it's all files, I suspect you'd want to add *.* at the end of the source path.

    Did you get an error? If so, can you post that up
     
  13. Django x2

    Capodecina

    Joined: 28 Sep 2008

    Posts: 13,252

    Location: Britain

    Ignore previous, tidied it up for you...

    Code:
    $source = "C:\Desktop\test\*.*"
    $dest = @("E:\Receive","\\mappeddrive\IT\Receive","D:\somewhereelse\)
    
    # Calling Copy-Item with parameters source: '$source', destination: '$dest'."
    foreach ($dir in $dest)
    {
        Copy-Item -Path $source -Destination $dir -PassThru
    }
    
    This will output to the console what is being copied and where (i've used passthru as opposed to verbose as it's a bit neater. It will also overwrite each time it's run (not sure if that's ideal for what you're trying to do). Lastly, it isn't really a simultaneous copy, but that's probably not a bad thing. It will copy all files from source to the first dest, then once that's complete, start again with the next dest, etc. The destination folders must exist.

    You should have PowerShellISE in your start menu, run that as admin and enter that code into the script window at the top, then click on the run (play arrow) once you've changed the $source and $dest paths to suit your needs. You'll notice I added the *.* to the source, otherwise it will just copy an empty folder over.

    Get that sorted, and I'll then show you how to make it a PowerShell module so you can just open PS and type in something like run-backup and it will do the rest. From that, we can even email the results as HTML or send a txt file output. Once you have a PS module, you can then create a scheduled task to run it.
     
    Last edited: 18 Jan 2020
  14. Mcnumpty2323

    Mobster

    Joined: 21 Dec 2019

    Posts: 3,538

    Thanks once again
    Yes used powershell
    As admin
    Gave no error message ~no message at all to indicate it was right or wrong
    I tried exactly as you wrote it first obviously
    As didn't work although no real idea how to use it
    Changing variables that seemed relevant to my drive set up seemed the thing to try
    Was almost 2am probably not best time to try lol
    I made folders as wasn't sure if just for example C as a source would be ok and just E, F, G as destinations was ok
    And not simultaneously is perfectly fine~the drives are all fast pci~e x4 M2 so could handle simultaneously if required but wasn't a neccessity
    At least hopefully I didn't make any massive screw ups as this is way beyond my capability
    So I thank you for your patience
    It's really appreciated

    Edit
    On pc in an hour or so to try again
     
  15. Mcnumpty2323

    Mobster

    Joined: 21 Dec 2019

    Posts: 3,538

    sorry took a while
    got sidetracked with other stuff
    clearly i am not doing it right as got lot of pink and red text
    and no run/play option

    i tried this===and wasnt sure about the \\mappeddrive\IT\Receive part so didnt alter that

    $source = "C:\Users\Administrator\Desktop\sendtodrives*.*"
    $dest = @("E:\sentfromdrives","\\mappeddrive\IT\Receive","F:\sentfromdrives\)

    # Calling Copy-Item with parameters source: '$source', destination: '$dest'."
    foreach ($dir in $dest)
    {
    Copy-Item -Path $source -Destination $dir -PassThru
    }


    [​IMG]

    thanks yet again
     
  16. Django x2

    Capodecina

    Joined: 28 Sep 2008

    Posts: 13,252

    Location: Britain

    Sorry, probably my fault for confusing things with the \\mappeddrive. That just shows you can use UNC paths (as long as the user running the PS script has access to the drives) as well as literal paths like C:\users\.

    A couple of things, you forgot the trailing slash at the end of your source (before the *.*) and you're missing a " at the end of your last destination folder. PowerShell will chew you up and spit you out for that :)

    In PowerShellISE, you need to use the script window (which you have hidden or minimised there). Click on View > Show Script Pane

    I suspect you want something like this:

    [​IMG]

    Note that my play button in the context bar is now green (because I've used the script window).
     
  17. Mcnumpty2323

    Mobster

    Joined: 21 Dec 2019

    Posts: 3,538

    Thanks will have a bash at it tomorrow
    Not sure how missed those out

    Must have pressed ctrl +c before had properly selected it or something dumb
    Yeah was being nosey looking around in options
    Must have forgot to bring script window back
    Thanks again for your patience