Topic "Can I add custom FTP commands"

Author Message
Richw46

Guest


I've searched the site but cannot find any relavent information.

When using WinSCP, is it possible to add / modify the FTP commands? We connect to Sterling Connect Enterprise which acts as an FTP host. Files can have the same name, it's a "Group" number that makes them unique, so if you just use the del command, you delete every file instead of just the one(s) you want to delete. The Connect Enterprise host can accept commands unique to that application that specify the Group number (actually, the batch number); see the $$ command below in quotes. I don't think custom commands are used for this but I don't see any way to send a command like this (where the batch number would be gleaned from the Group or else a prompt for the user to enter it.)

230 Connect:Enterprise UNIX login ok, access restrictions apply.
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for .
-CR-------FTP A vp2tms 164580 0 Jan 03 11:55 PRICING_CHGS
-CRT------FTP A vp2tms 5226 1764 Jan 04 00:48 PRICING_CHGS
Total number of batches listed: 2
226 Transfer complete.
ftp: 185 bytes received in 0.20Seconds 0.91Kbytes/sec.
ftp> del "$$ BID=#164580" (this number matches the Group number on the filename above)250 DELE command successful.
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for .
-CRT------FTP A vp2tms 5226 1764 Jan 04 00:48 PRICING_CHGS
Total number of batches listed: 1
226 Transfer complete.
ftp: 110 bytes received in 0.13Seconds 0.88Kbytes/sec.
ftp> bye
221 Goodbye.
C:\>
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
If I understand your problem, than custom command is actually the way to go.
_________________
Martin Prikryl
richw46

Guest


prikryl wrote:
If I understand your problem, than custom command is actually the way to go.


Maybe I'm not using custom commands correctly. When I put something in the command it tries to run it locally and doesn't recognize the command; del, dele, delete are all not recognized.

What I would like to happen is to select the file and instead of pressing 'delete' I want to execute the command del "$$ BID=#<a number>" and have the command executed on the server where the file resides. The $$ is a command that the ftp software on the server will recognize and delete the file with the group number instead of the name.

In the attached example I cannot just delete the 0-byte file or it will erase both files because they have the same name. I just want to delete the 0-byte file. If I connect with DOS FTP and issue the command del "$$ BID=#<1465>" then just that one is deleted.
example.jpg (35.49 KB)

Description: I want to be able to delete only the 0-byte file.

example.jpg

Freitag
[View user's profile]

Joined: 2007-10-25
Posts: 51
When you create a custom command there is a radio button that allows you to selct between "Remote command" and "Local command"

http://winscp.net/eng/docs/ui_customcommand
Richw46

Guest


Freitag wrote:
When you create a custom command there is a radio button that allows you to selct between "Remote command" and "Local command"


Remote is grayed out. Does 'remote' apply only to Windows servers? This is an FTP hosting software on UNIX but I've tried an account that connects to this hosting software and I've tried an admin account for the server. Both of them show a grayed out Remote button. I can select "Customize", create an entry, click the Remote button and save but on the button bar, unless I select Local, the command is grayed out. If I make it Local, then it prompts me for an entry (group number) but then errors with "Windows cannot find 'del'......"

The button bar has all Remote commands grayed out when I click on either side. Only Local commands are available, regardless of which side of the screen I'm on.
example1.jpg (35.68 KB)

Description: Screen shot of custom command window

example1.jpg

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Sorry. I've forgot the custom commands are not enabled for FTP.

The reason is just to avoid confusion. They are intended to run shell commands (what all the pre-defined commands show). What is not possible with FTP. With FTP they would run FTP protocol commands. What is ironically exactly what you want to do.

Not sure how to resolve that. Either allow power users to use it to run FTP commands or keep beginners safe by disabling it for FTP.

Last edited by martin on 2012-01-16; edited 1 time in total
richw46

Guest


Thanks Martin. I thought I was missing something. I appreciate the response

Rich
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