chde Posted August 26, 2015 Share Posted August 26, 2015 For starters i just wanna say im a COMPLETE noob when it comes to AutoIT.So i want AutoIT to start "AdobeCreativeCloudCleanerTool.exe" (which basically starts a command prompt), i then want AutoIT to send keys and press enter after each keypress.Example: Start AdobeCreativeCloudCleanerTool, wait 1 sec, press e, wait 1 sec, press enter and so on.AdobeCreativeCloudCleanerTool has no title so i cant use WinActive. It has a class (ConsoleWindowClass)Ive only come this far:ShellExecute("AdobeCreativeCloudCleanerTool.exe")Sleep(1000)Send("e")Sleep(1000)Send({ENTER}) The program starts, but no command is sent. How do i do this? Link to comment Share on other sites More sharing options...
MikahS Posted August 26, 2015 Share Posted August 26, 2015 Have you tried using:ControlCommand? Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Surya Posted August 26, 2015 Share Posted August 26, 2015 Try this :$pid = ProcessWait("AdobeCreativeCloudCleanerTool.exe") $hwnd = _GetHwndFromPID($pid) Sleep(1000) ControlSend($hwnd, "", "", "e",0) Sleep(1000) ControlSend($hwnd, "", "", "{ENTER}",0) Func _GetHwndFromPID($PID) $hWnd = 0 $stPID = DllStructCreate("int") Do $winlist2 = WinList() For $i = 1 To $winlist2[0][0] If $winlist2[$i][0] <> "" Then DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID)) If DllStructGetData($stPID, 1) = $PID Then $hWnd = $winlist2[$i][1] ExitLoop EndIf EndIf ConsoleWrite(@CRLF &$winlist2[$i][0]) Next Until $hWnd <> 0 Return $hWnd EndFunc ;==>_GetHwndFromPID No matter whatever the challenge maybe control on the outcome its on you its always have been. MY UDF: Transpond UDF (Sent vriables to Programs) , Utter UDF (Speech Recognition) Link to comment Share on other sites More sharing options...
AutoBert Posted August 26, 2015 Share Posted August 26, 2015 As a noob it's helpfull to read the help, specialy:Using AutoIt, whith all SubItemsTutorials, whith all SubItemsLanguage Reference, whith all SubItemsFunction Reference, from beginning to File, Directory and Diskmanagement specialy: ConsoleWriteProcess Management specialy: Run, StdErrRead, StdInWriteAlso helpfull is to search for Threads with TAG's Run, StdInWrite.Have you ever started the AdobeCreativeCloudCleanerTool with Option /h? Have a look if is possible to execute it silent with Parameters 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