Skip to content

Instantly share code, notes, and snippets.

@JC1738
Forked from danieltmckean/gist:2986396
Created November 22, 2013 22:43
Show Gist options
  • Save JC1738/7608160 to your computer and use it in GitHub Desktop.
Save JC1738/7608160 to your computer and use it in GitHub Desktop.
<script>
echo Dim oXMLHTTP, oStream > GetPE.vbs
echo Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0") >> GetPE.vbs
echo oXMLHTTP.Open "GET", "http://puppetmaster.local/boot/pe.msi", False >> GetPE.vbs
echo oXMLHTTP.Send >> GetPE.vbs
echo If oXMLHTTP.Status = 200 Then >> GetPE.vbs
echo Set oStream = CreateObject("ADODB.Stream") >> GetPE.vbs
echo oStream.Open >> GetPE.vbs
echo oStream.Type = 1 >> GetPE.vbs
echo oStream.Write oXMLHTTP.responseBody >> GetPE.vbs
echo oStream.SaveToFile "c:\Users\Administrator\Desktop\pe.msi",2 >> GetPE.vbs
echo oStream.Close >> GetPE.vbs
echo End If >> GetPE.vbs
echo CreateObject("WScript.Shell").Run "msiexec /qn /i c:\Users\Administrator\Desktop\pe.msi PUPPET_MASTER_SERVER=puppetmaster.local" >> GetPE.vbs
cscript GetPE.vbs
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment