Powder81 Posted April 15, 2005 Share Posted April 15, 2005 hello, i am building a program wich will use the cmd.exe.i have everything working except one little problem.my script works fine as long as the cmd.exe window is active.i dont want the cmd.exe window to be active, i want it hidden.so here comes my problem, how do i send my "commands" to the hidden window?Run("cmd.exe","whatever directory needed",@SW_SHOW) sleep(3000) Send("FTP{ENTER}") sleep(3000) Send("open ftp-ip{ENTER}") sleep(3000) Send("username{ENTER}") sleep(3000) Send("password{ENTER}") sleep(3000) Send("mput{ENTER}") sleep(3000) Send("blah.txt{ENTER}") sleep(3000) Send("y{ENTER}") sleep(3000) Send("bye{ENTER}") sleep(3000) Send("EXIT{ENTER}")Thats a generalized code, no personal info in it.That code works fine like i said, but how do i use the Send() when the cmd.exe is hidden?Thanks alot for your help. [font="Optima"]Every once in a while... we realize the sun does not rise on our command.[/font][font="Optima"]"Man Standing on Toilet is High on Pot" :Qui Con Jin[/font][font="Optima"]"Can't We All Just Get Along?" :The man who said that was shot by his brother shortly afterwards.[/font]Brand new site/forum i just started. As of 04/12/2005 no members.Check it out, join if you want. Link to comment Share on other sites More sharing options...
jpm Posted April 15, 2005 Share Posted April 15, 2005 the best can be to create a .cmd file you run. In Fact cmd is opening a windows that is different from regular windows so ControlSend which work on non active window cannot work in this case. Link to comment Share on other sites More sharing options...
torsti Posted April 15, 2005 Share Posted April 15, 2005 (edited) hello, i am building a program wich will use the cmd.exe.Send("FTP{ENTER}")why do you use cmd.exe if you actually want to run ftp.exe?also i'd advice you to use WinWaitActive after using Run to make sure the window is active. Edited April 15, 2005 by torsti Link to comment Share on other sites More sharing options...
layer Posted April 15, 2005 Share Posted April 15, 2005 yea, i suggest u do what jpm said, just write a batch/cmd file and run that instead of sending text to cmd.exe FootbaG Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted April 15, 2005 Share Posted April 15, 2005 That or BlockInput(1). I had to do that for my SSH tunneling program, since its run on the command line too. Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
w0uter Posted April 15, 2005 Share Posted April 15, 2005 if your trying to use ftp functions try the UDF from my signature My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Powder81 Posted April 15, 2005 Author Share Posted April 15, 2005 Thanks alot everyone, i think you have helped me alot. I really appreciate your support. [font="Optima"]Every once in a while... we realize the sun does not rise on our command.[/font][font="Optima"]"Man Standing on Toilet is High on Pot" :Qui Con Jin[/font][font="Optima"]"Can't We All Just Get Along?" :The man who said that was shot by his brother shortly afterwards.[/font]Brand new site/forum i just started. As of 04/12/2005 no members.Check it out, join if you want. Link to comment Share on other sites More sharing options...
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