How to create batch file using Psexec to install .msi on more than one computer?

hi guys

I've successfully been using the below batch file to install msi files on remote computers:
c:psexec.exe \remotecomputer -u DomainUsername -p Password msiexec.exe /i "\networkservernamesharenamemy.msi" /quiet /norestart

However, that's just for one PC. How can I do this, so that the installation takes place on multiple machines?

Thank you
Yashy



If you're reasonably sure the target machines are all online, prepare a file with the machine names (one name per line) and simply replace \remotecomputer with @"C:Tempmachines.txt" (or wherever you placed the file):



If you're reasonably sure the target machines are all online, prepare a file with the machine names (one name per line) and simply replace \remotecomputer with @"C:Tempmachines.txt" (or wherever you placed the file):



Aha, I see. That's fantastic man, thank you!!

So in the machines.txt file, should I do this:
\192.168.10.5
\192.168.10.6

and so on?



Just the names, no leading backslashes.
And for the fun of it, here's the version if you're not reasonably sure about the machines being online; it tries to ping them and creates a log file with the results. The script is in test mode and will only display the psexec commands it would normally run; remove the uppercase ECHO in line 12 to run it for real.



I don't even know what to say to that!

Now that's what I call giving an answer way above and beyond, fantastic stuff man. Really appreciate it.



Share this

Related Posts

There was an error in this gadget