Здравствуйте. Имеется простенький скрипт.
Что в него добавить чтобы он запускал exe и автоматически закрывался после нажатия любой из кнопок?
Код:
#include <GUIConstants.au3>
FileInstall('Optimal.jpg', @TempDir & '\Optimal.jpg')
GUICreate('Установка Windows', 625, 400)
GUICtrlCreatePic(@TempDir & '\Optimal.jpg', 0, 0, 625, 400)
GUICtrlSetState(-1, $GUI_DISABLE)
$font = "Times new roman"
$Button1 = GUICtrlCreateButton('Windows 7 x 86 AIO Rus', 20, 20, 290, 80)
GUICtrlSetFont(-1, 16, 700, 0, $font) ; Жирный шрифт
$Button2 = GUICtrlCreateButton('Windows 8.1 x 86 AIO Rus', 20, 115, 290, 80)
GUICtrlSetFont(-1, 16, 700, 0, $font) ; Жирный шрифт
$Button3 = GUICtrlCreateButton('Windows 10 x 86 AIO Rus', 20, 210, 290, 80)
GUICtrlSetFont(-1, 16, 700, 0, $font) ; Жирный шрифт
$Button4 = GUICtrlCreateButton('Windows 7 x 64 AIO Rus', 320, 20, 290, 80)
GUICtrlSetFont(-1, 16, 700, 0, $font) ; Жирный шрифт
$Button5 = GUICtrlCreateButton('Windows 8.1 x 64 AIO Rus', 320, 115, 290, 80)
GUICtrlSetFont(-1, 16, 700, 0, $font) ; Жирный шрифт
$Button6 = GUICtrlCreateButton('Windows 10 x 64 AIO Rus', 320, 210, 290, 80)
GUICtrlSetFont(-1, 16, 700, 0, $font) ; Жирный шрифт
$Button7 = GUICtrlCreateButton('Windows XP x 86 Professional Rus', 20, 305, 590, 80)
GUICtrlSetFont(-1, 16, 700, 0, $font) ; Жирный шрифт
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
FileDelete(@TempDir & '\Optimal.jpg')
Exit
Case $Button1
Run(run ("X:\windows\scripts\set7.exe"))
Case $Button2
Run(run ("X:\windows\scripts\set8.exe"))
Case $Button3
Run(run ("X:\windows\scripts\set10.exe"))
Case $Button4
Run(run ("X:\windows\scripts\set764.exe"))
Case $Button5
Run(run ("X:\windows\scripts\set864.exe"))
Case $Button6
Run(run ("X:\windows\scripts\set1064.exe"))
Case $Button7
Run(run ("X:\windows\scripts\setXP.exe"))
EndSwitch
WEnd
Что в него добавить чтобы он запускал exe и автоматически закрывался после нажатия любой из кнопок?