TrenalFrenal Posted April 22, 2010 Posted April 22, 2010 First off, I am a scripting novice and you'll be able to tell by the example. A co-worker of mine is responsible for the patch management of multiple customers with multiple locations per customer. We are having some bandwidth issues related to patch management at some of the locations and I wanted to come up with a way to download the updates we need to push out to a central machine at those locations and push the updates from that device. My first attempt at a push script is below, obviously it isn't built for multiple machines yet but I wanted to verify that I am deploying the updates the best way possible. I was hoping someone could point me in the right direction for the remote deployment. Thanks in advance. $a = InputBox ("Share", "Please enter share path", "") $b = InputBox ("XP Machine Name", "Enter Machine Name", "") $i = 1 FileInstall("D:\Patches\winxp.txt", "C:\winxp.txt", 1) Sleep (500) FileInstall("D:\Patches\psexec.exe", "C:\psexec.exe", 1) Sleep (500) $file = FileOpen("C:\winxp.txt", 0) Sleep (500) RunWait(@ComSpec & " /c " & "net use r: " & $a) Sleep (500) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf While $i = 1 Patch() $i = $i + 1 Wend Func Patch() While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop RunWait(@ComSpec & " /c " & "r:\psexec.exe \\" & $b & " -c " & "r:\" & $line & " /quiet /norestart") Wend EndFunc RunWait(@ComSpec & " /c " & "net use /d r:") FileClose($file)
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