#include <GuiIPAddress.au3>
$Form1 = GUICreate("Install scan HP LJ M1522n/nf", 300, 100)
GUICtrlCreateLabel("Введите IP", 50, 5, 100, 20)
$IPAddress = _GUICtrlIpAddress_Create($Form1, 50, 20, 100, 20)
$okbutton = GUICtrlCreateButton("OK", 50, 50, 70, 20)
$cancelbutton = GUICtrlCreateButton("Отмена", 180, 50, 70, 20)
$urlbutton = GUICtrlCreateLabel("http://odn.kz", 50, 80, 70, 20)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
ExitLoop
Case $okbutton
$IP = _GUICtrlIpAddress_Get($IPAddress)
WriteRunCMD($IP)
Case $urlbutton
ShellExecute("http://odn.kz")
Case $cancelbutton
ExitLoop
EndSwitch
WEnd
Func WriteRunCMD($IP)
$File = "Setup.cmd"
$hFile = FileOpen($File, 2)
$Command = 'hppniscan01.exe -f "hppasc08.inf" -m "vid_03f0&pid_4C17&IP_SCAN" -a "'&$IP&'" -n 1'
FileWrite($hFile, $Command)
FileClose($hFile)
ShellExecute($File)
Return
EndFunc