#include #include #include #include #include #include $Form1 = GUICreate("wmic commands", 300, 152, 337, 380) $Label1 = GUICtrlCreateLabel("Computername", 0, 8, 75, 17) $Input1 = GUICtrlCreateInput("", 0, 32, 125, 21) $Label2 = GUICtrlCreateLabel("wmic command", 150, 8, 77, 17) $Combo1 = GUICtrlCreateCombo("", 150, 32, 125, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Current_user|Model_Computer|Serial_Number|Bios_Version") $Button1 = GUICtrlCreateButton("run wmic", 150, 72, 91, 49) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $button1 $wmi = GUICtrlRead($combo1) $pc = GUICtrlRead($input1) call($wmi,$pc) EndSwitch WEnd Func Current_user($pc) RunWait(@ComSpec & ' /c ' & 'wmic /node:' & $pc &' computersystem get username > %temp%\username.txt' ,"", @SW_HIDE) $file=(@TempDir & "/username.txt") $fileread= FileRead($file) MsgBox(0, $pc , $fileread) FileDelete(@TempDir & "/username.txt") EndFunc Func Model_Computer($pc) RunWait(@ComSpec & ' /c ' & 'wmic /node:' & $pc &' computersystem get model > %temp%\model.txt' ,"", @SW_HIDE) $file=(@TempDir & "/model.txt") $fileread= FileRead($file) MsgBox(0, $pc , $fileread) FileDelete(@TempDir & "/model.txt") EndFunc Func Serial_Number($pc) RunWait(@ComSpec & ' /c ' & 'wmic /node:' & $pc &' bios get serialnumber > %temp%\serial.txt' ,"", @SW_HIDE) $file=(@TempDir & "/serial.txt") $fileread= FileRead($file) MsgBox(0, $pc , $fileread) FileDelete(@TempDir & "/serial.txt") EndFunc Func Bios_Version($pc) RunWait(@ComSpec & ' /c ' & 'wmic /node:' & $pc &' bios get smbiosbiosversion > %temp%\bios.txt' ,"", @SW_HIDE) $file=(@TempDir & "/bios.txt") $fileread= FileRead($file) MsgBox(0, $pc , $fileread) FileDelete(@TempDir & "/bios.txt") EndFunc