Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here is what I want to do - I would like to install a software on every PC in my domain. I would like it fully automated. I am sure this can be done either using a batch file or a vbscript. Here is what I would like to do:

  1. Check if file exists on local machine based on log file (related to step 4)
  2. If not, copy exe from server location e.g. \servername\c$\Temp to C:\Temp
  3. Run the installation (the app needs to be installed using cmd prompt so this step will most probably be a batch file)
  4. Log the results to a log file (.txt) on the server so that the script knows which PC has been completed.

I am completely new to scripting so can someone point me in the right direction? Many thanks in advance.

share|improve this question
add comment

1 Answer

First you need to determine whether the install can be run from the command line, and what switches are available/mandatory. If the installer is (or includes) a .msi, this is most likely the case.

PSExec is a tool by SysInternals (purchased by Microsoft, but kept under the SysInternals name - just search for it) that I use to do this kind of thing all the time. Create a file (I usually use "targets.list") that consists of all of the target systems, one per line. Place it in a directory with PSExec and your installer. Run "psexec @targets.list -c [filename] [arguments]".

The logging isn't great, but you can find plenty of scripts to list out computers' Installed apps. I often start at the Microsoft Script Center Repository. (This is probably easily accomplished in Powershell.) (One example is this script: "List All Installed Software".) Modify the script so that it only reports on the app you care about, or only lists machines that don't have it... I'd also set it up to also use the same "targets.list" file. There's more than one way to do it!

-Waldo

share|improve this answer
    
thanks for your reply. I have executed the install using psexec previously. But i had to do it a little differently. Basically launch cmd remotely and then run the command line install string so I am pretty sure it should work if i run it off locally. –  molecule Aug 25 '10 at 1:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.