Topic "Calling a WinSCP job from a remote PC"

Author Message
kmptrgeek
[View user's profile]

Joined: 2015-01-22
Posts: 1
Location: United States
I am trying to run a batch script from another PC. This batch script contains a WinSCP process. The rest of the batch script works fine, but I keep getting errors with the WinSCP portion of the program. I am a newbie, so the solution may be a very simple one. I am using "PS EXEC" to run the script from the local PC. The script on the remote PC is as follows:

__________________________________

cd c:\"Program Files"
cd Winscp

:getfile
winscp.exe /console /script=c:\RECON\getRECON.txt

if exist C:\RECON\Files\RECON* goto email

goto end

:email
Powershell.exe -executionpolicy remotesigned -File C:\RECON\emailRECONfiles.ps1

move /Y C:\RECON\Files\*.* C:\RECON\Archive

:end
exit
__________________________________

The WinSCP script is as follows:

__________________________________

#Open Connection

open [Saved Session]

# Change local directory

lcd C:\RECON\Files
cd RECON

# Force binary mode transfer

option transfer binary

# Download the file to current working directory then delete on SFTP folder

mget RECON*
rm RECON*

# Disconnect

close

# Exit WinSCP

exit
___________________________

The PowerShell script that emails works and everything else in the script works. I just keep getting emails with no attachments.

Thanks,

Update:

Never mind. I moved the WinSCP.ini file into the same directory that the WinSCP.exe was in and it worked perfectly.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License