Jump to content

list computers


Recommended Posts

hello,

afflicted for my English :lmao: but I was useful myself of a translator on line.

I write a script to launch the pstools (sysinternals).

Previously I wrote them in kix and I will want to pass them in Autoit.

I will want to automate the install of application on computers

I have a file : list of the computers.

script reads the file and takes again the line (computer name)

script :

.

.

For $x = 1 to $ligne[0]

RunAsSet("user","dom","pasword")

Run ("c:\\outils\pskill logon -t \\$ligne[$x]",'', @SW_MINIMIZE)

I must have pstools \\$ligne[$x] = \\computername

I must have a problem of syntax and I do not find

thank you for your assistance

Link to comment
Share on other sites

To combine a string with a variable use the & operator like so:

$text = "Hello"
$target = "world"
$finalstring = $text & " " & $target & ", how are you today?"
MsgBox(0, "Test", $finalstring)oÝ÷ Øò¢êÞÅ©©ëaÆÞr±«­¢+ÙIÕ¸ ÅÕ½ÐíèÀäÈìÀäÈí½ÕÑ¥±ÌÀäÈíÁÍ­¥±°±½½¸µÐÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±¥¹lÀÌØíát°ÌäìÌäì°M]}5%9%5%i¤
Link to comment
Share on other sites

Something like this:

Run ('c:\\outils\pskill logon -t \\' & $ligne[$x], @TempDir, @SW_MINIMIZE)
Link to comment
Share on other sites

Hope you can use it, had to translate it on the fly, so I hope there are no errors...

AutoItSetOption('TrayIconDebug', 1)

Global $AdminPass, $IPString='192.14.28.', $IniFile=@ScriptDir&'\Collector.log' , $Percent = 0, $Ping, $RPercent
Global $SkipFile = @ScriptDir&'\Global.ini', $StartIP=100, $StopIP=240 ; Common

If @UserName <> 'Administrator' Then ;Check for power
    $AdminPass = InputBox('Collector', 'Please gimme the password.', '', '*', '-1', '-1', '-1', '-1')
    Select
        Case @error = 0 ;OK - The string returned is valid
            RunAsSet('Administrator', @ComputerName, $AdminPass)
            If StringInStr(@ScriptFullPath, '.au3') Then
                Run('"' & @AutoItExe & '" "' & @ScriptFullPath & '" ' & $AdminPass)
            Else
                Run('"' & @ScriptFullPath & '" ' & $AdminPass)
            EndIf
            If @error Then MsgBox(4096 + 32, 'Error', 'Error starting under admin mode')
            Exit
        Case @error = 1 ;The Cancel button was pushed
            Exit
        Case @error = 3 ;The InputBox failed to open
            Exit
    EndSelect
Else
    For $IP = $StartIP To $StopIP Step 1
        $Percent = $Percent + 100/ ($StopIP - $StartIP + 1)
        $RPercent = Round($Percent, 0)
        If @IPAddress1 = $IPString & $IP Then ContinueLoop
        If IniRead($SkipFile, 'Skip', 'pc' & $IP, '') = 'Ping' Or IniRead($SkipFile, 'Skip', 'pc' & $IP, '') = 'INSTALLED' Then
            Information('Skipping', 1, 'PCEXEC', $IP)
            ContinueLoop
        EndIf
        $IniEntry = IniRead($IniFile, 'pc' & $IP, 'PSEXEC', 'Error'); check for done action (link)
        If StringInStr($IniEntry, 'Error') Or StringInStr($IniEntry, 'Ping') Then;no entry found
            $Ping = Ping($IPString & $IP, 150)
            If $Ping <> '0' Then; ping successful
                If Not FileExists('\\' & $IPString & $IP & '\c$\Win*') Then; IP not accessible
                    Information('No accessible PC.', 2, 'PSEXEC', $IP)
                    ContinueLoop
                EndIf
;~              ... Add your code here
            EndIf
        EndIf
    Next
EndIf

Func Information($a, $b, $c, $d); $a=Info, $b=1~ok/2~?/3~bad, $c=Type~Fixe/Link/Task, $d=IP
    Local $State
    TrayTip('clears any tray tip', '', 0)
    If $b = 1 Then
        $State = 'Success'
    ElseIf $b = 2 Then
        $State = 'Warning'
    ElseIf $b = 3 Then
        $State = 'Error'
    EndIf
    TrayTip('Collection at ' & $RPercent & '%.', $c & ': ' & $State & ' - ' & $a & ' (pc' & $d & ')', 10, $B)
    If Not StringInStr($a, 'Skipping') Then IniWrite($IniFile, 'pc' & $d, $c, $State & ' - ' & $a)
EndFunc   ;==>Information

You can have an Inifile with the IPs to skip and the IPs where your program is not installed.

You get response per tooltip and logfile.

If you want, I can post the original. I use that to update our virusdefs since our Server went down, giving us some time to set up something new.

Edited by dabus
Link to comment
Share on other sites

thank you uten and manabar I suspected that it was a history of "quote". I did not put them or it was necessary

thank you dabu it is for the installation of software on computers (more than 100 software and not on all the computers). I will take example to test the presence on line

thank you still with you all AutoIt is really unbon software of script

Link to comment
Share on other sites

  • 3 months later...

Hope you can use it, had to translate it on the fly, so I hope there are no errors...

AutoItSetOption('TrayIconDebug', 1)

Global $AdminPass, $IPString='192.14.28.', $IniFile=@ScriptDir&'\Collector.log' , $Percent = 0, $Ping, $RPercent
Global $SkipFile = @ScriptDir&'\Global.ini', $StartIP=100, $StopIP=240 ; Common

If @UserName <> 'Administrator' Then ;Check for power
    $AdminPass = InputBox('Collector', 'Please gimme the password.', '', '*', '-1', '-1', '-1', '-1')
    Select
        Case @error = 0 ;OK - The string returned is valid
            RunAsSet('Administrator', @ComputerName, $AdminPass)
            If StringInStr(@ScriptFullPath, '.au3') Then
                Run('"' & @AutoItExe & '" "' & @ScriptFullPath & '" ' & $AdminPass)
            Else
                Run('"' & @ScriptFullPath & '" ' & $AdminPass)
            EndIf
            If @error Then MsgBox(4096 + 32, 'Error', 'Error starting under admin mode')
            Exit
        Case @error = 1 ;The Cancel button was pushed
            Exit
        Case @error = 3 ;The InputBox failed to open
            Exit
    EndSelect
Else
    For $IP = $StartIP To $StopIP Step 1
        $Percent = $Percent + 100/ ($StopIP - $StartIP + 1)
        $RPercent = Round($Percent, 0)
        If @IPAddress1 = $IPString & $IP Then ContinueLoop
        If IniRead($SkipFile, 'Skip', 'pc' & $IP, '') = 'Ping' Or IniRead($SkipFile, 'Skip', 'pc' & $IP, '') = 'INSTALLED' Then
            Information('Skipping', 1, 'PCEXEC', $IP)
            ContinueLoop
        EndIf
        $IniEntry = IniRead($IniFile, 'pc' & $IP, 'PSEXEC', 'Error'); check for done action (link)
        If StringInStr($IniEntry, 'Error') Or StringInStr($IniEntry, 'Ping') Then;no entry found
            $Ping = Ping($IPString & $IP, 150)
            If $Ping <> '0' Then; ping successful
                If Not FileExists('\\' & $IPString & $IP & '\c$\Win*') Then; IP not accessible
                    Information('No accessible PC.', 2, 'PSEXEC', $IP)
                    ContinueLoop
                EndIf
;~              ... Add your code here
            EndIf
        EndIf
    Next
EndIf

Func Information($a, $b, $c, $d); $a=Info, $b=1~ok/2~?/3~bad, $c=Type~Fixe/Link/Task, $d=IP
    Local $State
    TrayTip('clears any tray tip', '', 0)
    If $b = 1 Then
        $State = 'Success'
    ElseIf $b = 2 Then
        $State = 'Warning'
    ElseIf $b = 3 Then
        $State = 'Error'
    EndIf
    TrayTip('Collection at ' & $RPercent & '%.', $c & ': ' & $State & ' - ' & $a & ' (pc' & $d & ')', 10, $B)
    If Not StringInStr($a, 'Skipping') Then IniWrite($IniFile, 'pc' & $d, $c, $State & ' - ' & $a)
EndFunc   ;==>Information

You can have an Inifile with the IPs to skip and the IPs where your program is not installed.

You get response per tooltip and logfile.

If you want, I can post the original. I use that to update our virusdefs since our Server went down, giving us some time to set up something new.

Thank you for shareing the script. It looks very interesting.

I'm trying to understand what is in the Global.ini file

I think it looks like:

[skip]

pc192.168.1.45

I don't understand where the Ping or Installed would be.

Do you have any examples of what you would put where it says "Add your code here" for something like running an AutoIt exe script?

Thank you,

Docfxit

Edited by docfxit
Link to comment
Share on other sites

Sorry, didn't see your post till now.

Looks like

-----Global.ini-----

[skip]

pc179=Ping

---------------------

This is done by me since I wanted to skip certain IPs like those of servers, JetDirect-Boxes and so on. So in my example obove, the IP $IPString&179 (here 192.14.28.179) would be take out of our loop.

You can place anything you want at ";~ ... Add your code here" . :) I use

FileCopy('\\server\NAV.exe', '\\' & $IPString & $IP & '\c$\NAV.exe', 1)
Run('cmd /c psexec.exe \\' & $IPString & $IP & ' cmd /c "C:\NAV.exe /Q"', 'c:', @SW_HIDE)

to copy the new virusdefinitions from our server to to the remote computer (drive C:) and even execute it. :D

Link to comment
Share on other sites

  • 8 years later...

I am getting an error on @UserName saying it's not declared.

I tried adding:

Global @UserName = ""

error: Statement cannot be just an expression.

#RequireAdmin
AutoItSetOption('TrayIconDebug', 1)
; ListComputers.ini    ;skip certain IPs like those of servers, JetDirect-Boxes
;----Start of file---- ;Do not place in file
;  [skip]
; pc179=Ping
; pc180=INSTALLED
;----End of file---- ;Do not place in file
; Both lines will cause the script to skip IP address $IPString & 179
;                                                     $IPString & 180
Global $AdminPass, $IPString = '192.168.168.', $IniFile = @ScriptDir & '\ListComputers.log', $Percent = 0, $Ping, $RPercent
Global $SkipFile = @ScriptDir & '\ListComputers.ini', $StartIP = 1, $StopIP = 182 ; Common
Global @UserName = ""

If @UserName <> 'Administrator' Then ;Check for power
    $AdminPass = InputBox('Collector', 'Please gimme the password.', '', '*', '-1', '-1', '-1', '-1')
    Select
        Case @error = 0 ;OK - The string returned is valid
            If StringInStr(@ScriptFullPath, '.au3') Then
                RunAs('Gary', @ComputerName, $AdminPass, 2, '"' & @AutoItExe & '" "' & @ScriptFullPath & '" ' & $AdminPass)
                ;            If StringInStr(@ScriptFullPath, '.au3') Then
                ;                Run('"' & @AutoItExe & '" "' & @ScriptFullPath & '" ' & $AdminPass)
            Else
                RunAs('Administrator', @ComputerName, $AdminPass, 2, '"' & @ScriptFullPath & '" ' & $AdminPass)
                ;                Run('"' & @ScriptFullPath & '" ' & $AdminPass)
            EndIf
            If @error Then MsgBox(4096 + 32, 'Error', 'Error starting under admin mode')
            Exit
        Case @error = 1 ;The Cancel button was pushed
            Exit
        Case @error = 3 ;The InputBox failed to open
            Exit
    EndSelect
Else
    For $IP = $StartIP To $StopIP Step 1
        $Percent = $Percent + 100 / ($StopIP - $StartIP + 1)
        $RPercent = Round($Percent, 0)
        If @IPAddress1 = $IPString & $IP Then ContinueLoop
        If IniRead($SkipFile, 'Skip', 'pc' & $IP, '') = 'Ping' Or IniRead($SkipFile, 'Skip', 'pc' & $IP, '') = 'INSTALLED' Then
            Information('Skipping', 1, 'PCEXEC', $IP)
            ContinueLoop
        EndIf
        $IniEntry = IniRead($IniFile, 'pc' & $IP, 'PSEXEC', 'Error'); check for done action (link)
        If StringInStr($IniEntry, 'Error') Or StringInStr($IniEntry, 'Ping') Then;no entry found
            $Ping = Ping($IPString & $IP, 150)
            If $Ping <> '0' Then; ping successful
                If Not FileExists('\\' & $IPString & $IP & '\c$\Win*') Then; IP not accessible
                    Information('No accessible PC.', 2, 'PSEXEC', $IP)
                    ContinueLoop
                EndIf
;~              ... Add your code here
                ;To copy the new virusdefinitions from our server to to the remote computer (drive C:) and even execute it
                ;   FileCopy('\\server\NAV.exe', '\\' & $IPString & $IP & '\c$\NAV.exe', 1)
                ;   Run('cmd /c psexec.exe \\' & $IPString & $IP & ' cmd /c "C:\NAV.exe /Q"', 'c:', @SW_HIDE)
            EndIf
        EndIf
    Next
EndIf

Func Information($a, $b, $c, $d); $a=Info, $b=1~ok/2~?/3~bad, $c=Type~Fixe/Link/Task, $d=IP
    Local $State
    TrayTip('clears any tray tip', '', 0)
    If $b = 1 Then
        $State = 'Success'
    ElseIf $b = 2 Then
        $State = 'Warning'
    ElseIf $b = 3 Then
        $State = 'Error'
    EndIf
    TrayTip('Collection at ' & $RPercent & '%.', $c & ': ' & $State & ' - ' & $a & ' (pc' & $d & ')', 10, $b)
    If Not StringInStr($a, 'Skipping') Then IniWrite($IniFile, 'pc' & $d, $c, $State & ' - ' & $a)
EndFunc   ;==>Information

Thank you,

 

Docfxit

Link to comment
Share on other sites

The macro @UserName is set by AutoIt to the "ID of the currently logged on user.". It can't be set by the user.

Which version of Autoit do you run?

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

Thanks for the reply Water...

I am running:

Production Ver. 3.3.14.0

Beta Ver. 3.3.15.0

I didn't see error on @UserName saying it's not declared.  When I ran it in SciTE.  I saw it in the AutoIt Debugger by Steve ver. 47

I just added a MsgBox in SciTE and I see @UserName is working correctly.  I will see if I can get a MSG to Steve to let him know of the problem.

Thank you very much,

Docfxit

Link to comment
Share on other sites

:)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

I would like to know how to display a box (during the execution of the program) with information in it that doesn't require the enter key like MsgBox to continue.

I would like to display $RPercent

And add every IP address it finds to the box.

Thank you,

Docfxit

Link to comment
Share on other sites

MsgBox allows to set a timeout - so no need to press a button.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

Please read the help file carefully: "The default is 0, which is no timeout."

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

When I use MSGBox with a 0 timeout what happens is:

The first Percentage gets displayed and stays on the screen until the script is completed.

I don't see the progress of the percentage changing while the script is completing.

I found an AutoIt cmd that will change on the screen while the percentage changes

ToolTip("Percent Done " & $RPercent & "%" & @CRLF & "IP Addresses Found " & _ArrayDisplay($aArrayIPAddressFound,"Text",$aArrayIPAddressFound[0] + 1, 64) , 800, 700)

ToolTip.thumb.jpg.a09239f62a25ba51588d5d

Currently is shows as above.  I would like to find out how to show the IP Addresses Found in the bottom window without the top window showing.

Thank you,

Docfxit

Link to comment
Share on other sites

It seems you are looking for a progress bar. You can display the percentage and any information you like. Check the help file for ProgressOn/ProgressOff/ProgressSet.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

On line 29 I can't get @error to show up.

#RequireAdmin
#include <Array.au3>
AutoItSetOption('TrayIconDebug', 1)
; Originally created by sergio17
; Added functunality by Docfxit
;   Added Tooltip to show live progress percentage & IP addresses found  live and IP addresses skipped
;
; ListComputers.ini    ;skip certain IPs like those of servers, JetDirect-Boxes
;----Start of file---- ;Do not place in file
;  [skip]
; pc179=Ping
; pc180=INSTALLED
;----End of file---- ;Do not place in file
; Both lines will cause the script to skip IP address $IPString & 179
;                                                     $IPString & 180
Global $IPString = '192.168.168.'
Global $IniFile = @ScriptDir & '\ListComputers.log'
Global $SkipFile = @ScriptDir & '\ListComputers.ini'
Global $StartIP = 1
Global $StopIP = 182
Global $User = "Taco"               ; This is the user that will run on remote PC's
Dim    $aArrayIPAddressFound[100]   ; This array needs to be adjusted to the maximum number of computers found

Global $AdminPass, $Percent = 0, $Ping, $RPercent
Global $IPAddressFound, $x  ; Common

If @UserName <> $User Then  ;Check for power user
    $AdminPass = InputBox("Password Required", "Please enter the password for user " & @CRLF & @CRLF & $User, "", "*")
MsgBox(0, "Test", "@error = ", @error)
Select
        Case @error = 0 ;OK - The string returned is valid
            If StringInStr(@ScriptFullPath, '.au3') Then
                RunAs('Gary', @ComputerName, $AdminPass, 2, '"' & @AutoItExe & '" "' & @ScriptFullPath & '" ' & $AdminPass)
                ;            If StringInStr(@ScriptFullPath, '.au3') Then
                ;                Run('"' & @AutoItExe & '" "' & @ScriptFullPath & '" ' & $AdminPass)
            Else
                RunAs($User, @ComputerName, $AdminPass, 2, '"' & @ScriptFullPath & '" ' & $AdminPass)
                ;                Run('"' & @ScriptFullPath & '" ' & $AdminPass)
            EndIf
            If @error Then MsgBox(4096 + 32, 'Error', 'Error starting under admin mode')
            Exit
        Case @error = 1 ;The Cancel button was pushed
            Exit
        Case @error = 3 ;The InputBox failed to open
            Exit
    EndSelect
Else
    For $IP = $StartIP To $StopIP Step 1
        $Percent = $Percent + 100 / ($StopIP - $StartIP + 1)
        $RPercent = Round($Percent, 0)
        ;       MsgBox(0,"Done", "Percent Done " & $RPercent & "%",0)

        ToolTip("Percent Done " & $RPercent & "%" & @CRLF & "IP Addresses Found " & $IPAddressFound, 800, 700)

        If @IPAddress1 = $IPString & $IP Then ContinueLoop ;IP address of first network adapter
        If IniRead($SkipFile, 'Skip', 'pc' & $IP, '') = 'Ping' Or IniRead($SkipFile, 'Skip', 'pc' & $IP, '') = 'INSTALLED' Then
            ;           MsgBox(0, "Information", "Skipping = " & "Skipping" & @CRLF & "1 = 1" & @CRLF & "pcexec = Pcexec" & @CRLF & "$IP = " & $IP)
            Information('Skipping', 1, 'PCEXEC', $IP)
            ContinueLoop
        EndIf
        $IniEntry = IniRead($IniFile, 'pc' & $IP, 'PSEXEC', 'Error'); check for done action (link)
        If StringInStr($IniEntry, 'Error') Or StringInStr($IniEntry, 'Ping') Then;no entry found
            $Ping = Ping($IPString & $IP, 150)
            If $Ping <> '0' Then; ping successful
                If Not FileExists('\\' & $IPString & $IP & '\c$\Win*') Then; IP not accessible
                    Information('No accessible PC.', 2, 'PSEXEC', $IP)
                    ContinueLoop
                EndIf
;~              ... Add your code here
                $x = $x + 1
                $aArrayIPAddressFound[$x] = $IPString & $IP
                $IPAddressFound = ""
                For $I = 1 To $x
                    If $aArrayIPAddressFound[$I] <> "" Then
                        $IPAddressFound = $IPAddressFound & @CRLF & $aArrayIPAddressFound[$I]
                    EndIf
                Next
                ;To copy the new virusdefinitions from our server to to the remote computer (drive C:) and even execute it
                ;   FileCopy('\\server\NAV.exe', '\\' & $IPString & $IP & '\c$\NAV.exe', 1)
                ;   Run('cmd /c psexec.exe \\' & $IPString & $IP & ' cmd /c "C:\NAV.exe /Q"', 'c:', @SW_HIDE)
            EndIf
        EndIf
    Next
EndIf

Func Information($a, $b, $c, $d); $a=Info, $b=1~ok/2~?/3~bad, $c=Type~Fixe/Link/Task, $d=IP
    ;           MsgBox(0, "Information", "$a = " & $a & @CRLF & "$b = " & $b & @CRLF & "$c = " & $c & @CRLF & "$d = " & $d)
    Local $State
    ;   ToolTip('clears any tray tip', '', 0)
    If $b = 1 Then
        $State = 'Success'
    ElseIf $b = 2 Then
        $State = 'Warning'
    ElseIf $b = 3 Then
        $State = 'Error'
    EndIf
    ;   TrayTip('Collection at ' & $RPercent & '%.', $c & ': ' & $State & ' - ' & $a & ' (pc' & $d & ')', 10, $b)
    ;   ToolTip('Collection at ' & $RPercent & '%.' & @CRLF & $c & ': ' & $State & @CRLF &  $a & ' (pc' & $d & ')', 800, 700)
    $x = $x + 1
    $aArrayIPAddressFound[$x] = $IPString & $d & " " & $a
    $IPAddressFound = ""
    For $I = 1 To $x
        If $aArrayIPAddressFound[$I] <> "" Then
            $IPAddressFound = $IPAddressFound & @CRLF & $aArrayIPAddressFound[$I]
        EndIf
    Next

    If Not StringInStr($a, 'Skipping') Then IniWrite($IniFile, 'pc' & $d, $c, $State & ' - ' & $a)
EndFunc   ;==>Information

Thank you,

 

Docfxit

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...