Script Center > Scripting Forums > The Official Scripting Guys Forum! > Using commandline tool psftp and store output
Ask a questionAsk a question
 

QuestionUsing commandline tool psftp and store output

  • Tuesday, November 03, 2009 10:41 AMueber3ber Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    Im trying to write a script, where I use psfts commandline tool.

    I already found examples were the output of the standard commands like "ping" or "fsutil" is stored. That works quite well!

    But when you start psfts you get an "own" commandline and it seems as you can't get to the output via StdOut.

    Are there any other ways to handle the output of commandline tools like that?

    Thanks in advance...

All Replies

  • Tuesday, November 03, 2009 1:19 PMTom Lavedas Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am not familiar with this utility, but did a quick google search and, as I expected, I found that psftp has a batch process that runs from a command script (see: http://the.earth.li/~sgtatham/putty/0.52/htmldoc/Chapter6.html#6.1.5).  In this mode, I expect the output can be redirected to a file or piped into another utility, like most other command line utilities.  For example, ...

       psftp -b:yourftpscript.txt -bc > output.txt

    I'd give that a try.

    Tom Lavedas
  • Tuesday, November 03, 2009 1:42 PMueber3ber Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    could work...let me check...
  • Wednesday, November 04, 2009 10:38 AMueber3ber Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    works quite well.

    Now I can see from the output textfile if the files were sent complete and delete them afterwards.

    I will post the script here when Im done, I think its a every day task and it should be foundable in the web.

    regards

    EDIT:

    One more thing:
    Is there a possibility to get the output (which I get at the moment via ">" to a text file) into the script again instead of getting it in a file?

    Thanks