Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all, I want to transfer data/file from linux machine to windows machine using scripting programing. how can i write script using commands.kindly help in this aspect. Thanks in advance, ...
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    2

    Question How to transfer a file from linux system to window system using script

    Hi all,
    I want to transfer data/file from linux machine to windows machine using scripting programing. how can i write script using commands.kindly help in this aspect.

    Thanks in advance,
    Kishor gupta.

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    The first step will to be set up the Windows machine to run an ssh server. I don't know the details of doing this, as I don't run Windows, but you will need this first step.

    Once you have done this, you can use the command scp to copy files via SSH between two computers. It works similarly to the normal cp command:
    Code:
    scp localuser@localmachine:/path/to/local/file remoteuser@remotemachine:/path/to/remote/file
    I don't know how this works with a Windows machine, but I'm sure that someone has done this before, and has explained it online.

    Good luck.
    DISTRO=Arch
    Registered Linux User #388732

  3. #3
    Just Joined!
    Join Date
    Jul 2009
    Posts
    2
    thanks for Reply.
    this command surely works if both machines r linux.R u sure scp will work for windows machines also.Let me know is it works or not.

    Regards,
    Kishor

  4. #4
    Linux Newbie
    Join Date
    Mar 2009
    Posts
    228
    Another approach, which is one that I use, is to install a free version of ssh on the Windows PC, and then pull the files from the Linux system to the Windows system. The free version I use is 'putty' and the command would look something like this:

    Code:
    drive:\path\to\pscp remoteuser@remotehost:/path/to/files drive:\path\to\dest\
    I assume you could write a DOS script to do this but I don't know DOS scripting. I do know that you'll have to set up public/private keys so a password won't be needed. That would be done with puttygen.

  5. #5
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,047
    Another way is to just create a samba share, but you could also use ftp. It depends on how you want it. scp is probably the safest way to do it over the internet. I dunno if you can make a sshfs share between Linux and Windows, but my guess is you can.
    Can't tell an OS by it's GUI

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...