Server Fault is a question and answer site for system and network administrators. 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 am trying to install software with GPO at comptuer shutdown.

My first question is it is possible to do it with Software Install in Win2003 Server?

Then I tried to put a batch script to shutdown script of computer from GPO. Script is like that:

if exist c:\mydlp-0.7.12.txt goto end
echo %date% %time% >> c:\mydlp-0.7.12.txt
msiexec /i \\\deploy\mydlp-endpoint-0.7.12.msi /qb /passive /forcerestart /l* C:\log.txt

It does not install it on shutdown, it starts to install however it does not complete installation. However, when I run batch script normally it runs and installs software successfully.

Thanks in advance.

share|improve this question
Hi, why are you choosing the install software on shutdown? surely using the group policy to deploy software would be more efficant and cause less problems? – JamesK Jan 19 '11 at 13:31
Our users are not patient enough to wait software installation on startup :) – Burak Oguz Jan 19 '11 at 15:39

The specific problem you're having is that MSIEXEC, called in that manner, runs asynchronously. Run it with a start /wait msiexec ... command and you'll get what you're looking for.

Having said that, you're replicating a subset of functionality that's already built into the Group Policy client. You should research Software Installation policy to see what it can do for you. You can create a reasonably scalable, deterministic automated software installation environment without writing any scripts. It's not perfect but it does the job in a lot of cases. It'll also be much easier for The Next GuyTM to understand than a maze of batch scripts that you'll create this way.

share|improve this answer
Thank you.. I will try that.. Our users are not patient enough to wait software installation on startup :). – Burak Oguz Jan 19 '11 at 15:01
My users are equally as anal :) (not all of them, in case they find this post!) – Mister IT Guru Jan 19 '11 at 15:08
Tried it. Not working :(, still same problem. Not waiting for installation and shutting down the computer. – Burak Oguz Jan 19 '11 at 15:13
@Burak: I'm occupied with a Customer right now. When I get some time I'll take a look at this. Shutdown scripts will be forcibly terminated after 10 minutes, by default. How long does this install take, normally? – Evan Anderson Jan 19 '11 at 15:47
It is not a huge file. msi size is ~10 MBs and installed size is 20 MBs. It should not take longer than 2 mins under normal circumstances. – Burak Oguz Jan 19 '11 at 17:27

Use the User logoff script. Not Computer shutdown. Network service is not available at shutdown, only at logoff.

You could copy the .msi file to the local drive and change the setup path so it doesn’t point to \\\* but to c:\*.

share|improve this answer

Your Answer


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.