#include opt("MustDeclareVars", 1) _MAIN() Func _MAIN() Local $YESID, $NOID, $EXITID, $MSG GUICreate("CMD OPEN", 320, 100) GUICtrlCreateLabel("CMD OPEn", 10, 10) $YESID = GUICtrlCreateButton("Notepad.exe", 10, 50, 50, 20) $NOID = GUICtrlCreateButton("CMD", 80, 50, 50, 20) $EXITID = GUICtrlCreateButton("Exit", 150, 50, 50, 20) GUISetState() Do $MSG = GUIGetMsg() Select Case $MSG = $YESID Run("notepad.exe") Sleep(1000) ;RunWait("net stop fcsam") ;Sleep(1000) Case $MSG = $NOID Run("cmd.exe") Sleep(1000) Case $MSG = $EXITID Case $MSG = $GUI_EVENT_CLOSE MsgBox(0, "Application Will Exit", "Close") EndSelect Until $MSG = $GUI_EVENT_CLOSE Or $MSG = $EXITID Or $MSG = $YESID Or $MSG = $NOID EndFunc Sleep("1000") Exit