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

Advertisement

Jobe
Joined:
Posts:
4
Location:
[Black bOx in the wall]

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

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 ....

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,469
Location:
Prague, Czechia

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

"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:

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

echo Uploading %DIR%\%FILE%

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

(not tested)

Reply with quote

Jobe
Joined:
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.

Reply with quote

Guest

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

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:

@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.

Reply with quote

martin
Site Admin
martin avatar

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

Use a full path to the winscp.com, like:

"C:\Program Files (x86)\WinSCP\WinSCP.com" /command ...

Reply with quote

Advertisement

Jobe
Joined:
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

Reply with quote

Jobe
Joined:
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

Reply with quote

Advertisement

You can post new topics in this forum