FTP connect with command
Moderators: white, Hacker, petermad, Stefan2
FTP connect with command
May'be a strange question:
I've created a FTP connection to my local sat decoder (127.0.0.1).
I cannot connect directly to my decoder but haven to open first a little FPT server program.
However I often forget to open this program before to create a connection with TC.
Is there a possibility to integrate a command in TC Ftp to do both things together (so open ftpserver.exe and after that connect to 127.0.0.1)?
I've created a FTP connection to my local sat decoder (127.0.0.1).
I cannot connect directly to my decoder but haven to open first a little FPT server program.
However I often forget to open this program before to create a connection with TC.
Is there a possibility to integrate a command in TC Ftp to do both things together (so open ftpserver.exe and after that connect to 127.0.0.1)?
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
This is a simple example using AutoHotkey. I assume that the ftp connection will be started with Ctrl-F, so I overwrite the key combination to first ask for confirmation if some other program (in your case the ftp server) should be started, notepad in my example.
Code: Select all
; Ctrl-F in Total Commander
#IfWinActive ahk_class TTOTAL_CMD
$^f::
MsgBox 4,, Notepad? ; Message box to ask if to start notepad
IfMsgBox Yes
{
Run notepad.exe ; ADJUST THIS FOR YOUR FTP SERVER
Sleep 2000 ; Wait 2 secs to give time for the process to start
}
WinActivate ahk_class TTOTAL_CMD ; Get the focus back to TC
Send ^f ; Start the ftp dialog
Return
I switched to Linux, bye and thanks for all the fish!
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
I dont know your ftp server, but i assume it is possible. What i would do is overwrite the Ctrl-Shift-F in TC, disconnect, then activate the server window, shut down the server.If I disconnect my local ftp connection (127.0.0.1) will it be possible with the same script p.e. to close notepad.exe?
That is even easier, as you can start a script on the button, which does all you need.Would it be possible as well to use activate this script clicking on my toolbar button FTP connection (cm_FtpConnect)?
I switched to Linux, bye and thanks for all the fish!
Thank you SanskritFritz,
However I don't know this script language.
Can you please tell me how I have to change the script adapting it to clicking on the Ftp connect button in the toolbar and clicking on the disconnect button under the toolbar?
(connect/disconnect script only if ftp server = local /127.0.0.1)
Can you please tell me where to find a good script language manual/guide with the topfield classes mentioned?
However I don't know this script language.
Can you please tell me how I have to change the script adapting it to clicking on the Ftp connect button in the toolbar and clicking on the disconnect button under the toolbar?
(connect/disconnect script only if ftp server = local /127.0.0.1)
Can you please tell me where to find a good script language manual/guide with the topfield classes mentioned?
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
Somehow it slipped my attention, sorry.@sanskritfritz, Have you seen my message above?
Now is the time to learn itHowever I don't know this script language.
You need a new button which starts a script like this:Can you please tell me how I have to change the script adapting it to clicking on the Ftp connect button in the toolbar and clicking on the disconnect button under the toolbar?
Code: Select all
MsgBox 4,, Start local ftp server?
IfMsgBox Yes
{
Run c:\Program Files\ftpserv\ftpserver.exe ; ADJUST THIS FOR YOUR FTP SERVER
Sleep 2000 ; Wait 2 secs to give time for the process to start (adjust if necessary)
}
WinActivate ahk_class TTOTAL_CMD ; Get the focus back to TC
Send ^f ; Start the ftp dialog
Return
That is pretty complicated, i dont know it now.(connect/disconnect script only if ftp server = local /127.0.0.1)
AutoHotkey has got an amazing help system. As mentioned above you cannot avoid to learn a little, if you want to use the scriptsCan you please tell me where to find a good script language manual/guide with the topfield classes mentioned?
I switched to Linux, bye and thanks for all the fish!
Thank you very much.
I found a solution with your help.
Just create a new button and insert this code:
--------------------------------------------------------
Run E:\server\FTP server\tops.exe /s
WinActivate ahk_class TTOTAL_CMD
Send ^f
Return
--------------------------------------------------------
I haven't found:
- how to disable server when I click on disconnect button
- I have more FTP connections. My button with the script above has to connect automatic to one of these connections without ftp dialog. Don't know ho to do this. May'be I can fill in some parameter after the ^f command
I found a solution with your help.
Just create a new button and insert this code:
--------------------------------------------------------
Run E:\server\FTP server\tops.exe /s
WinActivate ahk_class TTOTAL_CMD
Send ^f
Return
--------------------------------------------------------
I haven't found:
- how to disable server when I click on disconnect button
- I have more FTP connections. My button with the script above has to connect automatic to one of these connections without ftp dialog. Don't know ho to do this. May'be I can fill in some parameter after the ^f command
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
- SanskritFritz
- Power Member
- Posts: 3693
- Joined: 2003-07-24, 09:25 UTC
- Location: Budapest, Hungary
True, the disconnect button is on the ftp toolbar, which is TPanel1 most of the time, depending on how many connections you have made. Catching the click on the button is rather cumbersome as it is no distinct button but only painted onto the toolbar. You can know the position of it and catch the mouse click accordingly. I personally dont prefer this solution, rather i would put another button onto the main toolbar (next to the ftp connect button), where i would start a script to disconnect and stop the server.the ahk_class TDISCONNECT = doesn't exist
I switched to Linux, bye and thanks for all the fish!