Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a domain full of Windows computers (some are XP, some are Vista, most are 7). I want to run a single executable, once, on each machine without leaving my seat.

I have full administrative access to the entire network. Is there a straight forward way of doing this or am I going to have to get up?

share|improve this question
up vote 8 down vote accepted

There is an easy way to do this using psexec. You can get psexec from Microsoft at:

http://technet.microsoft.com/en-us/sysinternals/bb897553

Now what you'll need after installing that to somewhere in your PATH (for example c:\windows\system32), is a text file that has all of the hostnames that you want the command run on. Then you can simply run:

psexec @linktoTEXTfilehere -u username -p password commandtorunhere.exe

Just remember that if the filenames have any spaces in them, to surround them in quotes. Also, if you are using a domain account use the format domain\username when specifying the user to run as.

share|improve this answer
    
My new favourite toy! Thankyou! – JMK Apr 5 '12 at 14:45

It sounds like you want PSExec from Sysinternals.

e.g.

C:\>psexec \\* c:\bin\test.exe

The \\* part will attempt to run the specified command/program on every machine in the domain. Look at the options for PSExec as there are a number of useful switches you can flip.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .