How to use PSCP to copy file from one machine to another using vc++ code

raghav kuppili 1 Reputation point
2022-12-19T10:52:53.92+00:00

How to write this command using vc++ code, Through the command prompt it will executing this command but in vc++ how to invoke this command

Ex: pscp -pw Mypassword file.cfg root@127.0.0.1:/filesys/net/provisioned/file.cfg

Thank you in advance

Developer technologies C++
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 90,521 Reputation points
    2022-12-19T10:58:56.997+00:00
    0 comments No comments

  2. Viorel 122.5K Reputation points
    2022-12-19T11:32:56.623+00:00

    In vc++ you can try the system function:

    #include <stdlib.h>  
    . . .  
    system( "pscp -pw Mypassword file.cfg root@127.0.0.1:/filesys/net/provisioned/file.cfg" );  
    

    See also the _exec and _spawn functions.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.