Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Need help with deleting file from server

You are trying to call WinSCP from WinSCP. That cannot work.

It should be like:

winscp.com /log="C:\Users\trainee\Desktop\CrestronFW\ResultsDelete.log" ^
  /loglevel=-1 /ini=nul ^
  /script="C:\Users\trainee\Desktop\CrestronFW\FWremove.txt" ^
  /parameter ftp://anonymous:anonymous%40example.com@10.1.105.17/
 
winscp.com /log="C:\Users\trainee\Desktop\CrestronFW\ResultsDelete.log" ^
  /loglevel=-1 /ini=nul ^
  /script="C:\Users\trainee\Desktop\CrestronFW\FWremove.txt" ^
  /parameter ftp://anonymous:anonymous%40example.com@10.1.105.25/
...
marleymar

Need help with deleting file from server

Hello,

First time WinSCP use, I've created a script to remove files from an FTP server. I'm using a batch file to apply the script to multiple servers, the problem is the batch is only applying the script to the 1st server listed. can someone take a look at my batch code to see if I am missing something?

Thanks!
@echo off
 
"C:\Program Files (x86)\WinSCP\WinSCP.com"
  /log="C:\Users\trainee\Desktop\CrestronFW\ResultsDelete.log" /loglevel=-1 /ini=nul
  /command
    winscp.com /script="C:\Users\trainee\Desktop\CrestronFW\FWremove.txt" /parameter ftp://anonymous:anonymous%40example.com@10.1.105.17/
    winscp.com /script="C:\Users\trainee\Desktop\CrestronFW\FWremove.txt" /parameter ftp://anonymous:anonymous%40example.com@10.1.105.25/
    winscp.com /script="C:\Users\trainee\Desktop\CrestronFW\FWremove.txt" /parameter ftp://anonymous:anonymous%40example.com@10.1.105.33/
    winscp.com /script="C:\Users\trainee\Desktop\CrestronFW\FWremove.txt" /parameter ftp://anonymous:anonymous%40example.com@10.1.105.46/
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit /b %WINSCP_RESULT%