Can I add custom FTP commands

Advertisement

Richw46
Guest

Can I add custom FTP commands

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

Reply with quote

Advertisement

richw46
Guest

Re: Can I add custom FTP commands

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

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

example.jpg

Reply with quote

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.

Description: Screen shot of custom command window

example1.jpg

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
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

Reply with quote

Advertisement

You can post new topics in this forum