We help IT Professionals succeed at work.

How to deploy a custom hotfix (.VBS,.CMD)

Flipp asked
I have a batch file that stops a number of services, renames a file on client, copies a file to client from server, start services.

I was hoping to package and deploy this update to a group of PCs on a Windows Domain using Active Directory Group Policy.

The part I was hoping to get some direction on how best to perform this?
Watch Question

Distinguished Expert 2018
Honestly there is no good way to do this the way you are doing it. GPSI (Group Policy Software Installation) works only with MSI files, and won't work in this situation.

Alternatively, you could make this a startup or logon script, but then it runs every time. You could enhacen the batch file to the point that it has a way to check if it has already run, but it is still a pretty kludgy affair.

Ideally you'd kick this whole thing to the curb. Use an MSI creator (there are a few open-source ones, I prefer commercial ones...ScriptLogic's MSI Studio is very high on my list for essential sysadmin tools) and create a proper MSI for this. Then you can deploy it using any tool that depoys MSI including group policy, track deployment AND errors, and overall have a better experience with these types of scenarios.

With that said, this sounds like a pretty big edge-case. Manually copying a file itself sounds a bit iffy to me and usually I'd push back on the original software developer to provide a proper patch process (either they create the MSI, or at least give me a reasonable EXE instead of making me manually stop and start services and copy a file that may not be in the same location on every machine...)
I have used Group Policy to run many logon scripts. It works well. I have run tons of batch files that update a file in a certain folder on the PC. If you have your script to the point of working, it is easy. You can enhance your script to check to see if it has run, but even a simple script will work. If it is large files, of many files logon scripts are not so good. Then cgaliher's suggestion about creating MSIs will work better.
Group Policy>User>Windows Settings>Scripts for user based or
Group Policy>Computer>Windows Settings>Scripts for computer based.


Thank you all.

I ended up using NSIS, an open-source MSI creator.