Sign in to follow this  
Followers 0
sinsilenc

running software from one pc

4 posts in this topic

Ok what i am trying to do is send out an update then execute that update using an array. i have the part where i send it out but my problem is i dont know how i can execute all the software across the network. The way i have it now it opens the software that i sent out on the pc that has the auto it exe.

For $i = 0 To UBound($aMain) - 1
    dircopy($aSource, "\\"&$aMain[$i][0]&"\c$\sunrise",1)
    runwait("\\" & $aMain[$i][0] & "\c$\sunrise\test.exe")
    ;RunWait($aMain[$i][0] & "\sunrise.bat",'')
Next

Share this post


Link to post
Share on other sites



no one can help?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

PSExec?

:unsure:

yep just came to that conclusion i had completly forgot about it till i remembered my last job

; This example reads any csv file to a AutoIt 2D array.
#include <array.au3>
$aSource = "\\server"
$sExtCmd = 'SCHTASKS /Create /SC once /SD 05/16/2011 /ST 15:30:00 /TR "C:\WINDOWS\temp\CitrixOnlinePluginFull.exe"  /TN "software update" /ru system'
$rinstall1 = "C:\psexec>psexec \\"
$rinstall2 = " -u user -p password c:\software\batch.exe"
Local $sFile = "\\1acbuildroom\c$\software\software\Local files\test.csv"

;Get number of lines / rows
Local $aREResult = StringRegExp(FileRead($sFile), ".+(?=\v+|$)", 3) ; returns array of every line
Local $iNumLines = UBound($aREResult)
ConsoleWrite("$iNumLines; " & $iNumLines & @CRLF)

;Get number of commas / columns.
Local $aREResult = StringReplace(FileRead($sFile), ",", ",") ; returns number of commas in file
Local $iNumCommas = @extended
ConsoleWrite("$iNumCommas per row; " & Int($iNumCommas / $iNumLines) + 1 & @CRLF)

Global $aMain[$iNumLines][($iNumCommas / $iNumLines) + 1], $iRow = 0 ; Array for csv file

_CSVFileToArray($sFile) ; Fill array from file

_ArrayDisplay($aMain, "csv file Results")


Func _CSVFileToArray($sFile)
    Execute(StringTrimRight(StringRegExpReplace(StringRegExpReplace(FileRead($sFile), '"', '""'), "(\V+)(\v+|$)", 'Test1(StringRegExp("\1","([^,]+)(?:,|$)",3)) & '), 3))
EndFunc   ;==>_CSVFileToArray

; Fills each row of the required 2D array
Func Test1($aArr)
    For $x = 0 To UBound($aArr) - 1
        $aMain[$iRow][$x] = $aArr[$x]
    Next
    $iRow += 1
    Return
EndFunc   ;==>Test1
For $i = 0 To UBound($aMain) - 1
    dircopy($aSource, "\\"&$aMain[$i][0]&"\c$\software",1)
    ;runwait("\\" & $aMain[$i][0] & "\c$\software\test2.exe")
    ;RunWait($aMain[$i][0] & "\software.bat",'')
    ;Runwait("\\" & $aMain[$i][0] & "\c$\sunrise\test3.exe")
    runwait(@ComSpec & " /c " & $rinstall1 & $aMain[$i][0] & $rinstall2)
    
Next

ok here working code to install to every domain computer

This uses a 2d array thats imported from a csv

Edited by sinsilenc

Share this post


Link to post
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
Sign in to follow this  
Followers 0