Local $filename
If $CmdLine[0] = 1 Then
$filename = $CmdLine[1]
else
MsgBox(0, "ERROR", "File not found")
Exit
EndIf
; Wait for 5 seconds.
Sleep(5000)
; Wait 10 seconds for the Upload window to appear
Local $hWnd=WinWait("[CLASS:#32770]","",10)
; Set input focus to the edit control of Upload window using the handle returned by WinWait
ControlFocus($hWnd,"","Edit1")
; Wait for 2 seconds.
Sleep(2000)
; Set the File name text on the Edit field
ControlSetText($hWnd, "", "Edit1", $filename)
Sleep(2000)
; Click on the Open button
ControlClick($hWnd, "","Button1");