Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6550687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:14:46+00:00 2026-05-25T12:14:46+00:00

How to copy a directory from a windows system to a remote windows system

  • 0

How to copy a directory from a windows system to a remote windows system using ant

there is one scp command and FTP command, please provide me an example to perform this task using scp and ftp.

Also scp requires SSH which is not common for windows system.

So how to use SCP on windows system using ant

Also if you know any better approach for windows system using ant or java, please share

Also there is one SC command(don’t know how to use it)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:14:47+00:00Added an answer on May 25, 2026 at 12:14 pm

    Download:

    <scp file="${username}:${password}@${ip}:${path-to-file}" todir="${dir}" trust="true" />
    

    or Upload:

    <scp file="${path-to-file}" todir="${username}:${password}@${ip}:${dir}" trust="true" />  
    

    Ant scp task provides attributes such as localFile and remoteFile to replace “file”, and localTofile / localTodir and remoteTofile / remoteTodir to replace “dir”. Using these attributes can help avoid confusion when you need some scp tasks to get files from the server to local machine, while others to upload files from the local machine to server.
    Like this (for uploading):

    <scp localFile="${path-to-file}" remoteTodir="${username}:${password}@${ip}:${dir}" trust="true" />
    

    Check the ant manual to see more information:
    http://ant.apache.org/manual/Tasks/scp.html

    Note:
    1. Avoid copying multiple files; Copy a zip archive and a ant build file together with it, and unzip on target machine.
    2. Using scp, you need to setup ssh server on the target machine; you also need to put jsch.jar in your ANT_HOME/lib. The jsch.jar can be downloaded from

    http://www.jcraft.com/jsch/index.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I copy some directory from one place to another (not file by
i want to copy a directory from one drive to another drive. My selected
I need to copy a jar file from one directory to another when my
I'm trying to copy a directory using the Ant copy task. I am a
I have a windows service set to copy files from a local directory to
I installed LAMP on Ubuntu 11.04 and copy project from Windows. PHP directory (/ci/)
Assume there exists the directory structure C:\users\myuser\Desktop\bob\marley. In windows, from the starting directory C:\users\myuser\Desktop
Is there a way to copy an entire directory to the output directory in
Trying to write a simple C# script to copy file to directory one level
I need to copy a directory form one source form multiple destination . For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.