Topic "rm works on command lin but not in script!"

Author Message
[View user's profile]

Joined: 2014-12-21
Posts: 2
Location: Belgium
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
root@ (18.96 KB) [Download]

Description: (none)

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
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

Martin Prikryl
[View user's profile]

Joined: 2014-12-21
Posts: 2
Location: Belgium
Embarassed So simple, yet so helpfull!

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License