you could add you script as a separate package and add it as a dependent package to this one. So after the installation of your office, the dependet package will be executed!
that´s as I know not possible. You have to add the commands into for example a batch-script and add this script as a package to it.
You can use a bundle. The 'group' you create your Distribution Package in can also be scheduled. (Except the default Public/My/All Groups) If you go to the properties of the bundle you can also change the order and handle failures and reboots.
You will have to convert your 'old' custom script to a cmd/VBScript or Powershell script though, or use the Windows Actions distribution packages to create more packages into the bundle.
Frank's on the money.
You create a bundle - with "Package A" (the thing you want to install) being the first thing, and then "the script" you want to run, being the 2nd package.
You can even create different versions for 32-bit vs 64-bit for instance (if you want/need to specify bitness) and keep them in the same bundle. (new feature added in IEM 2016 that I quite like) ... and a 32-bit client will automatically install (only) the 32-bit packages, while a 64-bit client will only install the 64-bit packages.
Saves you from having to have 2 separate bundles for the same piece of operations .
Thanks for your response. But in my environment, batch file was limited.Do you have any good ideal to convert a batch file to powershell?
Many thanks Frank. You helps me a lot.
1 of 1 people found this helpful
You can convert a batch file into Powershell pretty easily.
Powershell will run most of the commands just fine. You may need to play with the syntax a little if you're using parameters ... but for things like "copy * D:\MyLocation\" will work just fine.
I've not had to cmd-lines in Powershell often, but they do work (usually). Give it a try & work from there.
(On the plus side - Powershell is a lot smarter than Batch, so you can do smarter things in it. That may make your scripting a lot easier!).
So - yeah - "it can be done". The rest is down to you playing with Powershell.
Here's a couple of resources I found useful when I was getting friendly with it (links to 3rd parties are obviously out of my control):
- (as usual) Google & Stackoverflow will be your friends for sure!
- UPDATE the powershell help (you'll need to run the ISE "as admin" and type "update-help"). The default help stinks, but the updated help includes a lot of examples for every command and is really helpful more often than not!
... hmm - OK, based upon trawling through my "library" of saved examples, I was all over the place (i.e. - "google my specific function / scenario I'm having issues with") and go from there. Not had a single site (other than Stackoverflow & google) hold more than 1-2 key items. So ... use those 2 and you should be good for most things.
Hope that helps.