susu6514 Posted December 21, 2009 Share Posted December 21, 2009 Hi,I'm new to autoit and I have a problem to print a "2-digit" variable in DOS command prompt.Here is my code.Dim $i$i=10While $i <=11Run("cmd.exe")WinWaitActive("C:\WINDOWS\system32\cmd.exe")Send("{" & $i & "}")sleep (2000)send("{ENTER}")send("type digonly.txt|sed -e 1,3d -e5,8d > 9_")send("{"&$i&"}")sleep (1000)send(".txt")send("{ENTER}")WinClose("C:\WINDOWS\system32\cmd.exe")$i=$i+1WEndWhen I run the above program, the variable,i, should start from "10" but as I send i to DOS prompt by using "Send("{" & $i & "}")" the result output in DOS prompt is "1".I am so confused that why it cannot display "10" in command prompt.Please some one help me. Thank you so much! Link to comment Share on other sites More sharing options...
somdcomputerguy Posted December 21, 2009 Share Posted December 21, 2009 (edited) I don't know if this is why it doesn't work as expected, but you have the syntax wrong for the WinWaitActive command.Function WinWaitActiveAlso, the WinClose syntax is wrong too.<br><br>Edit: For the actual problem though, try this. Change the value here, SendKeyDelay (Option), it defaults to 5, try 10 or higher..<br> Edited December 21, 2009 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
susu6514 Posted December 21, 2009 Author Share Posted December 21, 2009 I changed Send("{" & $i & "}") to Send(&i) and problem solved. As to other incorrect usage, I will look into it. Thanks for the reply. 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