locked
Script to execute bunch of .exe file in order RRS feed

  • Question

  • Hi colleagues,

    I need a scripts(power-shell or batch or Vbs) to do something like this.

    My requirement is...

    1.I have bunch of .exe files(of firmware, updates, drivers etc) and need to install these one after other, without manual intervention. i.e. unattended installation.

    2.If possible lets show the installation wizard, so that I could see which update is currently running.

    3. Should start another .exe upon completion of previous installation, do not mind if its success or failure.

    4. Write a log for each and every .exe in single file or multiple files. Success or failure reports upon completion of installation.

    5.Should be one restart after all the executions, not individually.

    I have been searching scripts for a while but I could not get it. Can some one help me out here.

    thanks,

    Dharanesh,

    Thursday, December 4, 2014 7:40 AM

Answers

  • Hi,

    May be, can i have forum link at least, where do i post it???

    I do understand but Here am not asking for a new script, i hope someone might have used it and this is basic stuff.


    This is not basic stuff but rather a whole project specification. If you have no experience in scripting then you need to hire a consultant to write the script for you. Note also this trap: When you put the names of your .exe files into a batch file then you expect them to execute one after the other, each waiting for its predecessor to finish its job before starting up. This will not necessarily work. Some .exe files will return control to the batch file immediately, even before they have finished, resulting in more than one running at the same time.
    • Marked as answer by Bill_Stewart Thursday, January 22, 2015 4:24 PM
    Thursday, December 4, 2014 9:38 AM

All replies

  • I am sorry but thisis bot a forum for free consulting.  If you need custom scripts please contact a consultant.

    Please see the forum guidelines: https://social.technet.microsoft.com/Forums/en-US/a0def745-4831-4de0-a040-63b63e7be7ae/posting-guidelines?forum=ITCG


    ¯\_(ツ)_/¯

    Thursday, December 4, 2014 8:23 AM
  • Hi,

    May be, can i have forum link at least, where do i post it???

    I do understand but Here am not asking for a new script, i hope someone might have used it and this is basic stuff.

    regards,

    Dharanesh,



    • Edited by Dharanesh Thursday, December 4, 2014 8:54 AM
    Thursday, December 4, 2014 8:51 AM
  • Hi,

    May be, can i have forum link at least, where do i post it???

    I do understand but Here am not asking for a new script, i hope someone might have used it and this is basic stuff.


    This is not basic stuff but rather a whole project specification. If you have no experience in scripting then you need to hire a consultant to write the script for you. Note also this trap: When you put the names of your .exe files into a batch file then you expect them to execute one after the other, each waiting for its predecessor to finish its job before starting up. This will not necessarily work. Some .exe files will return control to the batch file immediately, even before they have finished, resulting in more than one running at the same time.
    • Marked as answer by Bill_Stewart Thursday, January 22, 2015 4:24 PM
    Thursday, December 4, 2014 9:38 AM
  • Yeah a batch will go through the list of commands and read them off to the computer without stopping unless you specify it. Also consider each executable can function differently when being remotely called, and it's usually best to research silent install practices for each install you have to process.  You're definitely not going to just find a solution to cut and paste as Frederik says, this is project work.  To at least get you started here are some answers to your requirements so you can start researching what you'll need to do -

    1.I have bunch of .exe files(of firmware, updates, drivers etc) and need to install these one after other, without manual intervention. i.e. unattended installation

    -- Each application must be research for the proper method to install the executable silently.

    2.If possible lets show the installation wizard, so that I could see which update is currently running.

    -- http://technet.microsoft.com/en-us/library/hh849921.aspx -- You can write-output for any progress you wish to display. 

    3. Should start another .exe upon completion of previous installation, do not mind if its success or failure.

    -- http://technet.microsoft.com/en-us/magazine/hh360993.aspx -- You can create installation functions for each executable that must be installed, with the correct install parameters you've researched, and then call those functions based on the order you want.  http://blogs.msdn.com/b/kebab/archive/2013/06/09/an-introduction-to-error-handling-in-powershell.aspx will help you with how to handle errors from each installation.

    4. Write a log for each and every .exe in single file or multiple files. Success or failure reports upon completion of installation.

    -- http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/23/weekend-scripter-creating-a-sample-log-file-by-using-powershell.aspx -- This ones easy, and this link will help you with how to log what you're doing within the script.

    5.Should be one restart after all the executions, not individually.

    -- This goes back to you doing proper research of each install you have to process.  Each install will require a do not restart switch, and each executable will most likely have it's own way to process the install without restart. 

    Having written PS unattended solutions, including a recent one that handles 16 images, 2 Operating Systems, and now 24 models of hardware, I can tell you this is most definitely a lot of work.  Hope this helps you get started at least.  Good luck.

    Thursday, December 4, 2014 5:08 PM
  • It's easy to do something like this with a little research, but it can have significant consequences: look up "The Sorcerer's Apprentice" on Youtube if you're not familiar with the story.

    I had to do something very similar over 5 years ago and centered it around a batch file using the START command with the /WAIT parameter for each of the chained installs. The core script was a dozen virtually identical lines. Debugging it for installers of different flavors with different quirks (for example, terminating themselves after starting the real install process) took a couple of weeks of work spread out over 3 months of real-world time.

    Brooks has posted a great list of items you'll need to consider; re-reading it reminded me of just how many quirks there were. And if you're not familiar with scripting, I tend to agree with jrv: you'll have to choose between outsourcing to someone qualified, or spending quite a bit of your own time learning how to code. The choices aren't mutually exclusive.

    Friday, December 5, 2014 1:26 AM
  • Thank you guys..much appreciated and i  will come back to you. Am Currently running with a basic batch file, it runs without any issues, logs are stored in some default location, but i wanted try something like this is PS.

    I think i should put my head around this.

    regards,

    Dharanesh,

    Friday, December 5, 2014 11:34 AM