SlimShady Posted July 9, 2004 Posted July 9, 2004 (The search function didn't find any results.) Ok, I would like to send commands to a command box. AutoIt3 Spy didn't find any controls. Here's why I want it... I'm gonna create an AutoIt FTP client. And for the connection and transfer I want to use the command line. There are two ways to make a connection: 1) start the FTP subenvironment and send each command by hand (or using AutoIt) 2) run a command that reads a file that contains FTP commands The problem with the second approach is: The command creates a connection and performs actions. So with every action you take in my Gui it has to make a new connection. But I want the script to open a command box (hidden) and send commands. When the user is finished, he/she presses on "Disconnect" and the right command is sent. So, how do I send text to a command box. Thank you for your time...
pekster Posted July 9, 2004 Posted July 9, 2004 Here's what I would do:Write the ftp commands to use to a temporary text fileCall the ftp command like this: Run(@ComSpec & " /c ftp -n -s:temp1.txt ftp.domain.com", "", @SW_HIDE)That line of code will start a hidden command prompt window that will start executing ftp commands found in the requested temp file. It also won't log in by default, so your first 2 lines should be a user/pass combo. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.
SlimShady Posted July 9, 2004 Author Posted July 9, 2004 (edited) I know that.Like I said:The problem with the second approach is:The command creates a connection and performs actions.So with every action you take in my Gui it has to make a new connection.I just wanna know if someone found a way to send text to a command box (if there's a way).If there's no way, I'll just search for a third-party FTP tool... Edited July 9, 2004 by SlimShady
pekster Posted July 9, 2004 Posted July 9, 2004 My method will make a new connection every time you call that line of code with a relevant text file full of ftp commands. As an example, run the following code and it will open two command windows with each ping:Run(@ComSpec & " /c ping www.yahoo.com -t") Run(@ComSpec & " /c ping localhost -t") [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.
SlimShady Posted July 9, 2004 Author Posted July 9, 2004 I'm sorry, I wasn't very clear. I don't want to make a new connection on every action. When the user presses connect it connects to the host. And then the script waits for actions from user. Eg: Rename file, upload file, download file, list files. I'll try out some other tools. If they're not usable in a batch file. I'll just do what I kept avoiding; new connection on every action.
pekster Posted July 9, 2004 Posted July 9, 2004 Oh, now I see what you want. I think you can do that, but I'm not sure how to detect when the command has finished. Normally when using a command prompt you can tell because you are returned to a prompt instead of the "busy" indicator. You can ControlSend text to a command window, although it does have a problem with the shift state. To solve that you can use my ControlSendPlus UDF that I developed for this exact problem.If you just want a nice FTP client, check out FileZilla. You can set it up so that it only uses 1 connection, or however many you need. It also support a queue, and many other usefull features. Best of all, it's free and open source. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.
SlimShady Posted July 9, 2004 Author Posted July 9, 2004 I was searching for a third-party utility... That's just stupid. Yeah. At home I use FileZilla. The reason why I'm making scripts like this, is because I want to be mobile with all the tools I need (use). I will do the following: - create a FTP client GUI When you connect, it opens a command box. When you perform an action, the script sends required information to the command window WinHide/WinShow will be used on the command window.
pekster Posted July 9, 2004 Posted July 9, 2004 Yeah. At home I use FileZilla.The reason why I'm making scripts like this,is because I want to be mobile with all the tools I need (use).Why not use FileZilla when you're on the go too? You can get the zip copy and extract it to a directory on your computer at home. Once there, start it up the first time, tell it to use the XML file (not the registry), and finally burn that to a CD. Then, you can use FileZilla wherever you are without needing to install it. I do a similar trick with my iPod and use it as a removable hard drive on repair jobs. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now