Category Archives: bring process to front

Bring a Process to Front for User Focus – AutoIT Script

Compile the following script using AutoIT and pass the process to be brought to front as commandline


For Example: BringToFront.exe “Caculator”



 AutoIt Version: 3.3.0.0
 Author:         myName


 Script Function:
Bring Window to front.


#ce —————————————————————————-
AutoItSetOption(“TrayIconHide”, 1)


If $CmdLine[0] > 0 Then
$WinTitle = $CmdLIne[1]
Else
Exit 1
EndIf
If $CmdLine[0] > 1 Then
$WinText = $CmdLIne[2]
Else
$WinText = “”
EndIf


WinWait($WinTitle, $WinText, 60)
If WinExists($WinTitle, $WinText) Then
WinActivate($WinTitle, $WinText)
EndIf