Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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)


Topic review


:oops: So simple, yet so helpfull!

Re: rm works on command lin but not in script!

You are obviously executing a different script than the one you have posted.

> 2014-12-21 15:15:56.843 Script: option batch abort
> 2014-12-21 15:15:56.843 Script: option confirm off
> 2014-12-21 15:15:56.843 Script: open scp://root:***@
> 2014-12-21 15:15:59.673 Script: get *.txt c:\Users\Erich\MCVLogs\DataTemp\
> 2014-12-21 15:15:59.733 Script: close

rm works on command lin but not in script!

I am using this script to transfer a file and delete the source file.
The result is a perfect tranfer, but removing the source doen't work.
After checking the forum, I tryed using the latest version, checking the user (root) and the permissions, using "get -delete" al without succes.
Checking the log (attached) it seems as if after the succesfull transfer, winspc closes, discarting any statements after the "get". I tried adding a "echo" or even repeating the same "get" statement, they don't show in the log.

Executing "rm *txt" from the command line works perfect!

What am I missing? Thanks for helping!!

# USAGE: C:\Program Files (x86)\WinSCP> /script=ScpScript2.txt
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect
open scp://root:stiff14tree@
# Download file to the local directory
get -delete *.txt c:\Users\Erich\MCVLogs\DataTemp\
rm *.txt
# Disconnect
# Exit WinSCP