Topic "need help in scripting an short transfer script that I'm to stupid to handle by my self.."

Author Message
Jobe
[View user's profile]

Joined: 2016-12-15
Posts: 4
Location: [Black bOx in the wall]
Hi

I need a little help with writing a short script.
I've tried a bit but my dyslexia and ADHD isn't s very good combination when you need to search and combine information from different sources.

The problem should be easy, but not for me.

I need to via uTorrent function "to execute a command after each torrent is finished" that winscp moves the download(s) (using the -delete function) but I can't get a grasp about it.
I have no idea how to get winscp to transfer the information from uTorrent (%D for directory and %F for single file torrents) to the scrip file, and how to make the bat file to know if it's a single file or directory (and transfer the information to winscp)

Just thinking of this makes my head spinn like the exorcist ....
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26138
Location: Prague, Czechia
"moves the download": Where should it move the downloads to? Upload them somewhere?

Regarding the %F and %D:

If you call a batch file in the uTorrent like this: upload.bat "%D" "%F"; then in the batch file, you can pass the information to the WinSCP like:

Code:
@echo off
set DIR=%1
set FILE=%2

echo Uploading %DIR%\%FILE%

winscp.com /command ^
    "open ..." ^
    "put ""%DIR%\%FILE%"" ""/remote/path/""" ^
    "exit"


(not tested)
Jobe
[View user's profile]

Joined: 2016-12-15
Posts: 4
Location: [Black bOx in the wall]
Yeah, sorry I forgot that.

After the download it should put the files to my sftp site.

I've read something about you must use the /parameter to relay the file and folder information to the script..

And you have written all in a bat file. Now I'm more confused.

I've successfully created a script where it connects and login to the sftp server, so that part works.
Guest




martin wrote:
"moves the download": Where should it move the downloads to? Upload them somewhere?

Regarding the %F and %D:

If you call a batch file in the uTorrent like this: upload.bat "%D" "%F"; then in the batch file, you can pass the information to the WinSCP like:

Code:
@echo off
set DIR=%1
set FILE=%2

echo Uploading %DIR%\%FILE%

winscp.com /command ^
    "open ..." ^
    "put ""%DIR%\%FILE%"" ""/remote/path/""" ^
    "exit"


(not tested)


well that didn't work, not a DOS command the system replied.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26138
Location: Prague, Czechia
Use a full path to the winscp.com, like:

"C:\Program Files (x86)\WinSCP\WinSCP.com" /command ...
Jobe
[View user's profile]

Joined: 2016-12-15
Posts: 4
Location: [Black bOx in the wall]
Hi

Sorry for the long delay.

Actually when I run the bat file or just opens winscp and displays the winscp> prompt
Nothing more happens, until I wrote exit, and then the bat file continued and displayed error messages for the rest of the command in your line...
Open is not an internal, external or program ... So the commands are not transferred into winscp

Attaching screenshot (Swedish)
dos.png (16.08 KB)

Description: (none)

dos.png

Jobe
[View user's profile]

Joined: 2016-12-15
Posts: 4
Location: [Black bOx in the wall]
Update:. Somehow the texteditor added carrier return.

However a new error had occurred, see screenshots
up2.png (18.17 KB)

Description: (none)

up2.png

Guest




Oops.. found the error, of course it was my fault,. A " Sign had disappeared!
Embarassed
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