Search code examples
windowsunixvbscriptcopysamba

How can I script copying files from Unix to Windows?


Is there any way a script can be made that copies files from a Unix drive onto a Windows drive?


Solution

  • I do it manually all the time using secure copy (SCP). SCP comes already installed on most Unix machines. On my PC, I installed PuTTY which is a secure terminal app for Windows and also contains a secure copy utility.

    When you do the secure copy manually from the Windows command line, you put your Unix username into the command line command, but then you have to type in your password at the prompt, so it's interactive. But I've also thought about doing it from a script or a batch file. In that case, you will need to create and install private and public keys on the appropriate machines. I created the appropriate keys and installed them on both the Windows and Unix machines and then I manually performed the Windows command line secure copy again and it did not ask me for my password that time. So this is one way you can accomplish your task. I'm sure there are many other ways, though.