steve06 0 Posted October 20, 2010 Im very new to all this, just trying to figure out how to automate a button click. For example i am just trying to make a GUI with a button that says defrag and then once clicked i want it to open the defrag application and click on the button to start it. This is my case within a while loop: Run('dfrgui.exe') WinWaitActive("Disk Defragmenter") Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}") This was working but has now stopped for some reason. I would prefer it if there was a way I could simply automate the programme to send a click to 'button 2' ...? Any help would be great. Thanks Share this post Link to post Share on other sites
JohnOne 1,603 Posted October 20, 2010 (edited) I'm guessing that defrag has command line switches so I think this would be the wrong way to go about your task.For ideas about how to acheive your goal, take a look at Valuaters MAXOFF program, which I think employs it. Edited October 20, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Tvern 11 Posted October 20, 2010 I agree with JohnOne, but if you just want to restore the old scripts functionality you should be able to use this: Run('dfrgui.exe') $hWnd = WinWaitActive("Disk Defragmenter") ControlClick($hWnd,"","[CLASSNN:Button3]") Make sure the windows title is "Disk Defragmenter". If it doesn't work, use the au3info tool to confirm the button you want to click has the CLASSNN "Button3". Share this post Link to post Share on other sites
steve06 0 Posted October 20, 2010 Thanks! This worked perfectly! Share this post Link to post Share on other sites