Код скрипта WAV2WMA.au3

Код:
#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode 
$mainwindow = GUICreate("Конвертор WAV в WMA", 350, 160)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlCreateLabel("Графическая оболочка к консольной программе WM8EUTIL.exe", 10, 3)

GUICtrlCreateGroup ( "Пути", 5, 20, 340, 95)

GUICtrlCreateLabel("Путь к кодировщику", 10, 35)
$EncPath = GUICtrlCreateEdit ( "Укажите кодер",  10, 50, 300, 20, $ES_READONLY+$WS_HSCROLL)
$EncButton = GUICtrlCreateButton ( "xxx", 311, 50, 30, 20)

GUICtrlCreateLabel("Путь к результату", 10, 75)
$WMAPath = GUICtrlCreateEdit ( "Укажите директорию",  10, 90, 300, 20, $ES_READONLY+$WS_HSCROLL)
$WMAButton = GUICtrlCreateButton ( "xxx", 311, 90, 30, 20)

$okbutton = GUICtrlCreateButton("Кодировать!", 270, 117, 77, 42)

GUICtrlSetOnEvent($EncButton, "EncButton")
GUICtrlSetOnEvent($WMAButton, "WMAButton")
GUICtrlSetOnEvent($okbutton, "OKButton")

GUICtrlCreateLabel("Битрейт", 10, 120)
$BitRate = GUICtrlCreateCombo ("", 10, 135)

GUICtrlCreateLabel("Частота", 70, 120)
$Samp = GUICtrlCreateCombo ("", 70, 135)

GUICtrlCreateLabel("Каналов", 130, 120)
$Stereo = GUICtrlCreateCombo ("", 130, 135)

	GUICtrlSetData ( $EncPath, IniRead ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "EncPath", ""))
	GUICtrlSetData ( $WMAPath, IniRead ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "WMAPath", ""))
	GUICtrlSetData ( $BitRate, "5|6|8|10|12|16|20|22|32|40|48|64|80|96|128|160|192", IniRead ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "BitRate", "192"))
	GUICtrlSetData ( $Samp,    "8|11|16|22|44|48", IniRead ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "Samp", "48"))
	GUICtrlSetData ( $Stereo,  "1|2", IniRead ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "Stereo", "2"))

GUISwitch($mainwindow)
GUISetState(@SW_SHOW)

While 1
  Sleep(1000)  ; Idle around
WEnd

Func EncButton()
	$var = FileOpenDialog ( "Указать пусть к кодеру", "", "Исполняемый файл (WM8EUTIL.exe)", 1)
	if StringLen ($var) > 0 then GUICtrlSetData ( $EncPath, $var)
EndFunc

Func WMAButton()
	$var = FileSelectFolder ( "Директория для результата", "", 0)
	if StringLen ($var) > 0 then GUICtrlSetData ( $WMAPath, $var)
EndFunc

Func OKButton()
	$var = StringLen ( $CmdLine[2] )
	Run('"' & GUICtrlRead ($EncPath) & '"' & ' -input ' & StringLeft( $CmdLine[2], $var - 1 ) & ' -output ' & GUICtrlRead ($WMAPath) & '\ -a_setting ' & GUICtrlRead ($BitRate) & '_' & GUICtrlRead ($Samp) & '_' & GUICtrlRead ($Stereo), "")
	CLOSEClicked ()
EndFunc

Func CLOSEClicked()
	IniWrite ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "EncPath", GUICtrlRead ($EncPath) )
	IniWrite ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "WMAPath", GUICtrlRead ($WMAPath) )
	IniWrite ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "BitRate", GUICtrlRead ($BitRate) )
	IniWrite ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "Samp", GUICtrlRead ($Samp) )
	IniWrite ( @WindowsDir & "\Autoit.ini", "WAV2WMA", "Stereo", GUICtrlRead ($Stereo) )
    Exit
EndFunc