MrWho Posted April 19, 2011 Share Posted April 19, 2011 Hi Guys, One of the friends from here posted this script Is there a way to feed a list of computers to that script .. ( list of IP/Hostnames ) Thank you very much expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <Constants.au3> #include "array.au3" #include <GUIConstants.au3> Dim $line Dim $item $GUI = GUICreate("My GUI" , 800 , 600) $listview = GuiCtrlCreateListView ("Indication|Computer|Ip|Status ", 40,40,400,500) GUISetState (@SW_SHOW) $foo = Run(@ComSpec & " /c net view ", @SystemDir, @SW_HIDE,2) While 1 $sActiveLine = StdoutRead($foo) If @error Then ExitLoop If StringLeft($sActiveLine, 2) = "\\" Then $line &= StringReplace($sActiveLine, "\\" , "") & @CRLF EndIf Wend $line = StringReplace($line, " " , "") $line = StringReplace($line, @LF,"") $line = StringSplit ($line, @CR) TCPStartup() For $i = 1 To $line[0] - 1 $result = Ping($line[$i] ,1) If NOT @ERROR Then $line[$i] = GuiCtrlCreateListViewItem($line[$i] & "|" & TCPNameToIP($line[$i]) &"|ONLINE",$listview) GUICtrlSetImage(-1, "shell32.dll",21) Else $line[$i] = GuiCtrlCreateListViewItem($line[$i] & "|" & TCPNameToIP($line[$i]) &"|OFFLINE",$listview) GUICtrlSetImage(-1, "shell32.dll",22) EndIf Next TCPShutdown() while 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Link to comment Share on other sites More sharing options...
martin Posted April 20, 2011 Share Posted April 20, 2011 It looks like a strange script to me. It uses net view which gives a list of connected computers. It then converts the computer names to an ip , which is not necessary, then pings using the ip but using the name would work, to find out if the computer which is connected is connected. So I would expect that half of the script could be removed. Anyway, the point is that you need to learn a language if you want to use it and you need to have written or modified something yourself which you are having trouble with to get much help here IMO. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
CH0VI3 Posted April 20, 2011 Share Posted April 20, 2011 (edited) Hi MrWho,I have found a sample in here, that is called "pingtest1.6.1.zip". Have a look around and see if this is what you are looking for.Kind RegardsCH0VI3 Edited April 20, 2011 by CH0VI3 Link to comment Share on other sites More sharing options...
UEZ Posted April 20, 2011 Share Posted April 20, 2011 (edited) Here something I wrote - just download it: http://www.autoit.de/index.php?page=Thread&postID=220550 Screenshot: http://www.autoit.de/index.php?page=Attachment&attachmentID=15983 Any feedback would be great! Br, UEZ Edited July 18, 2012 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Fr0zT Posted July 19, 2011 Share Posted July 19, 2011 (edited) Well I'm a bit late to the ball here but for reference you might want to check out an AutoIt ping utility I wrote here: It is fully multi-threaded(real threads, not timers or adlib) so it works well for pinging multiple IP's simultaneously. Also you can feed a list in simply by enumerating and calling pingThreaded("x.x.x.x") Edited July 19, 2011 by Fr0zT [size="1"][font="Lucida Console"]My ScriptsTrue multi-threaded ping[/font][/size] Link to comment Share on other sites More sharing options...
travelerjjm Posted May 18, 2012 Share Posted May 18, 2012 UEZ, I tried your code and got these errors. Maybe I have too new a version of something? expandcollapse popup"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\John\gcheck Online Status\Check Online Status.au3" /UserParams +>14:18:29 Starting AutoIt3Wrapper v.2.1.0.8 Environment(Language:0409 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64) >Running AU3Check (1.54.22.0) from:C:\Program Files (x86)\AutoIt3 C:\Program Files (x86)\AutoIt3\Include\WinAPI.au3(159,38) : ERROR: $TMPF_FIXED_PITCH previously declared as a 'Const'. Global Const $TMPF_FIXED_PITCH = 0x01 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files (x86)\AutoIt3\Include\WinAPI.au3(160,33) : ERROR: $TMPF_VECTOR previously declared as a 'Const'. Global Const $TMPF_VECTOR = 0x02 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files (x86)\AutoIt3\Include\WinAPI.au3(161,35) : ERROR: $TMPF_TRUETYPE previously declared as a 'Const'. Global Const $TMPF_TRUETYPE = 0x04 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files (x86)\AutoIt3\Include\WinAPI.au3(162,33) : ERROR: $TMPF_DEVICE previously declared as a 'Const'. Global Const $TMPF_DEVICE = 0x08 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(115,103) : WARNING: $WS_EX_TOPMOST: possibly used before declaration. Global Const $Label = GUICtrlCreateLabel("", 222, 538, 66, 17, $SS_CENTER + $SS_SIMPLE, $WS_EX_TOPMOST) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(123,83) : WARNING: $WS_VSCROLL: possibly used before declaration. BitOR($GUI_SS_DEFAULT_LISTVIEW, $LVS_AUTOARRANGE, $LVS_NOSORTHEADER, $WS_VSCROLL) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(124,26) : WARNING: $WS_EX_CLIENTEDGE: possibly used before declaration. BitOR($WS_EX_CLIENTEDGE, ~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(181,27) : WARNING: $WM_COMMAND: possibly used before declaration. GUIRegisterMsg($WM_COMMAND, ~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(182,31) : WARNING: $WM_CONTEXTMENU: possibly used before declaration. GUIRegisterMsg($WM_CONTEXTMENU, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(357,95) : WARNING: $STDOUT_CHILD: possibly used before declaration. Local $run = Run(@ComSpec & " /c ping -a -n 1 -4 " & $ip, @SystemDir, @SW_HIDE, $STDOUT_CHILD) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(369,106) : WARNING: $WS_EX_TOOLWINDOW: possibly used before declaration. Local Const $hGUI_IP = GUICreate("IP Range (class c only)", 354, 179, -1, -1, Default, $WS_EX_TOOLWINDOW, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(485,78) : WARNING: $GUI_SS_DEFAULT_GUI: possibly used before declaration. $hGUI_Settings = GUICreate("Settings", 612, 229, -1, -1, $GUI_SS_DEFAULT_GUI, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(518,131) : WARNING: $WS_TABSTOP: possibly used before declaration. $cSlider = GUICtrlCreateSlider(88, 138, 440, 30, BitOR($TBS_BOTH,$TBS_NOTICKS, $TBS_ENABLESELRANGE, $TBS_FIXEDLENGTH, $WS_TABSTOP) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(556,28) : WARNING: $WM_HSCROLL: possibly used before declaration. GUIRegisterMsg($WM_HSCROLL, ~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(765,74) : WARNING: $COLOR_MENU: possibly used before declaration. $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_MENU) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(115,103) : ERROR: $WS_EX_TOPMOST: undeclared global variable. Global Const $Label = GUICtrlCreateLabel("", 222, 538, 66, 17, $SS_CENTER + $SS_SIMPLE, $WS_EX_TOPMOST) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(123,83) : ERROR: $WS_VSCROLL: undeclared global variable. BitOR($GUI_SS_DEFAULT_LISTVIEW, $LVS_AUTOARRANGE, $LVS_NOSORTHEADER, $WS_VSCROLL) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(124,26) : ERROR: $WS_EX_CLIENTEDGE: undeclared global variable. BitOR($WS_EX_CLIENTEDGE, ~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(181,27) : ERROR: $WM_COMMAND: undeclared global variable. GUIRegisterMsg($WM_COMMAND, ~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(182,31) : ERROR: $WM_CONTEXTMENU: undeclared global variable. GUIRegisterMsg($WM_CONTEXTMENU, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(357,95) : ERROR: $STDOUT_CHILD: undeclared global variable. Local $run = Run(@ComSpec & " /c ping -a -n 1 -4 " & $ip, @SystemDir, @SW_HIDE, $STDOUT_CHILD) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(369,106) : ERROR: $WS_EX_TOOLWINDOW: undeclared global variable. Local Const $hGUI_IP = GUICreate("IP Range (class c only)", 354, 179, -1, -1, Default, $WS_EX_TOOLWINDOW, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(485,78) : ERROR: $GUI_SS_DEFAULT_GUI: undeclared global variable. $hGUI_Settings = GUICreate("Settings", 612, 229, -1, -1, $GUI_SS_DEFAULT_GUI, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(518,131) : ERROR: $WS_TABSTOP: undeclared global variable. $cSlider = GUICtrlCreateSlider(88, 138, 440, 30, BitOR($TBS_BOTH,$TBS_NOTICKS, $TBS_ENABLESELRANGE, $TBS_FIXEDLENGTH, $WS_TABSTOP) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(556,28) : ERROR: $WM_HSCROLL: undeclared global variable. GUIRegisterMsg($WM_HSCROLL, ~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3(765,74) : ERROR: $COLOR_MENU: undeclared global variable. $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_MENU) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\John\gcheck Online Status\Check Online Status.au3 - 15 error(s), 11 warning(s) Link to comment Share on other sites More sharing options...
water Posted May 18, 2012 Share Posted May 18, 2012 The $TMPF_* constants have been defined in another UDF you included. As WinAPI is an UDF that comes with AutoIt you should remove the constants from one of the non-default UDFs. All other missing constants just show that another default UDF is missing. Add#AutoIt3Wrapper_Add_Constants=yand the missing files will be included automatically. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
UEZ Posted May 18, 2012 Share Posted May 18, 2012 @travelerjjm: which AutoIt version you are using? Seems to be that your version is an older one. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
travelerjjm Posted May 19, 2012 Share Posted May 19, 2012 I am running 3.3.8.1 which is the current version according to the site. Link to comment Share on other sites More sharing options...
travelerjjm Posted May 19, 2012 Share Posted May 19, 2012 I copied the code directly.I understand about the missing constants and fixed that as you suggested. I still have dups in the $TMPF constants.from WinAPI. I only included what you did. I commented them out of APIConstants.au3 and the code runs. I'm not sure why the values are duplicated in the include files. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now