• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 957
  • Last Modified:

help with PSFTP

hello i have a PSFTP script and i need to run it form a bach file how can i do this ?
0
Chris Jones
Asked:
Chris Jones
  • 6
  • 4
1 Solution
 
Bill PrewCommented:
In the BAT file, do a line like this (assuming PSFTP.EXE is in your PATH):

psftp user@hostname -b myscript.scr

~bp
0
 
Chris JonesAuthor Commented:
how do i put a file in juyst put the echo command in teh bacth that i call ?
0
 
Bill PrewCommented:
I don't understand your question.

It sounded like you already had an PSFTP script file that you use with that program now, is that correct?  Of do you need to create the PSFTP command file as well?

I'm not sure what you meant by "put a file in"?

~bp
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
Chris JonesAuthor Commented:
i have this in a bact file will this work

put "\\ctis\dfsroot\EnrollmentReports\symplicity\student.csv" >> psftp.bat
0
 
Chris JonesAuthor Commented:
then i have a script with this

psftp commercetamudrop@commerce-tamu-advocate.symplicity.com -pw ********** -b psftp.bat
0
 
Chris JonesAuthor Commented:
any ideal ?
0
 
Chris JonesAuthor Commented:
I've requested that this question be deleted for the following reason:

no answers
0
 
Bill PrewCommented:
It's good practice to wait a bit longer to close a question with a reason of no answers.  Most Experts here have full time jobs, so only allowing a ferw hours for a solution is not enough time.

Try this as your BAT file.  It will create a CTL file with the PUT command in it, and then pass that to PSFTP when it runs.  Save the below as your BAT file.

@echo off
echo put "\\ctis\dfsroot\EnrollmentReports\symplicity\student.csv"> psftp.ctl
echo quit>> psftp.ctl
psftp commercetamudrop@commerce-tamu-advocate.symplicity.com -pw ********** -b psftp.ctl

Open in new window

~bp
0
 
Chris JonesAuthor Commented:
thank you this worked great
0
 
Bill PrewCommented:
Great, glad that helped, thanks for the feedback.

~bp
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now