Avatar of mbudman
mbudman
Flag for Canada asked on

How to run a batch file once using Group Policy objects

Hello,

I want to use Group Policy to automatically run a program (batch script) that does the following:

1.  Check if program exists
2. If program does not exist, install the program (run executable, create service and start it)

No user input is required (program automatically installs silently)
The only limitation is it might require administrator level account to install

The file to complete the installation is a batch file.

I understand that I can possibly accomplish this by putting the batch file into "startup" ->Computer Configuration->Policies->windows settings->scripts-startup. However, my understanding is that the server would have to be rebooted to launch the script. I do not want to do so as the installation does not require a reboot and the destination servers are not supposed to be rebooted

Someone also suggested that perhaps I can use run once of the registry, but I am not certain if this would work.

Any suggestions on how to accomplish my goal?

Thanks in advance.
Windows BatchWindows OS

Avatar of undefined
Last Comment
Seth Simmons

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Michael Pfister

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mbudman

ASKER
1.I would like the program to execute once the computer updates itself  with group policy, not when user logs on
2. An MSI is not the way to go because the batch file accesses a share and executes the program. The sequence of steps are:
    a. Check if program is installed. If installed abort
    b. Connect to windows share and run installation program
    c. start program service
    d. end

The advantage of connecting to a share is I can update the program on the fly without modifying anything else. In any case, this is much easier than an MSI (imo).
SOLUTION
Michael Pfister

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mbudman

ASKER
I do not mind deploying an MSI. I have never built an MSI. I should have various tools at my disposal as we are a software shop.

I only need the task to run once on each computer I select. This should be done automatically. Installation should not depend on the user.
Seth Simmons

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Split:
-- Michael Pfister (https:#a42454194)
-- Michael Pfister (https:#a42455116)


If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

seth2740
Experts-Exchange Cleanup Volunteer
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck