Jump to content

Recommended Posts

Posted (edited)

I have seen a few requests for the ability to continue a script after a reboot. I do this all the time, especially during holiday shutdown each year when I have a laundry list of tasks to perform on all systems. I have had as many as 40+ tasks, many of which reboot themselves, or won't continue if they see another installation that has not reboot yet (gotta love Microsoft).

Here is the shell script that I used to get it done.

Version 1

  Reveal hidden contents

------

Here's my new version. Some people had trouble remembering not to skip numbers, or to keep them in order, so this one puts it all in an array, so you don't have to manually keep track of task IDs.

Version 2

  Reveal hidden contents

------

MSUpdates Module

  Reveal hidden contents

This module was written for the Version 1 script, and has not been tested for Version 2.

First, you will need to download WuInstall from http://www.wuinstall.com/index.php/en/free.

(This is an excellent utility, so I highly recommend purchasing a Pro copy)

Unzip and place the WUInstall.exe file in a folder beneath your script called 3rdParty.

--Edit--

Added Version 2 of script

modified log path in Version 2 (see posts 5&6)

Added MSUpdates module

Edited by willichan
Posted

Nice! Haven't tested yet but I did something similar too.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • 10 months later...
Posted

I did a rewrite of this shell to accommodate some people that were editing my scripts, but couldn't remember to keep tasks IDs consecutive. This new one is going into use for 2011 end-of-year cleanup. See post #1 for both versions.

Posted

I personally wouldn't hard-code the C: drive destination but instead opt for saving to a different location such as @AppDataCommonDir.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

  On 12/29/2011 at 8:28 AM, 'guinness said:

I personally wouldn't hard-code the C: drive

I agree with you. This script comes from an internal end-of-year cleanup script, and the log file location was decided on "by committee", and gets deleted in a few days anyway. I'll change it in the top post though, when I get a few minutes this morning.

Posted

Ok. I have had alot of people contacting me, both from the forum and from without, wanting the MS Updates script. I went ahead added it to post #1.

I am glad to see that so many people are able to make use of this shell script.

  • 2 years later...
Posted

Nice post. I was wondering how would you edit script #1 to remove versioning, but keep everything else. For example, I still want it to go through all the stages instead of going straight to stage 3 (based on your example).

Posted

That kind of defeats the purpose of the script.  The idea behind this script is to be able to continue where you left off after a reboot.

If you want to start from stage one every time you can just call a regular script?

Or am I misunderstanding your question?

Posted

So I just saw this and I have not tested, but reading through the code, I have a couple questions.

How do you autostart the app on reboot? Do you have UAC enabled? 

Posted

We have UAC turned off for all of our machines, and have a special domain account set up for doing our cleanups.  It has sufficient rights for all of the tasks needed, and has the cleanup script followed by a mandatory reboot in its login script.  That way, we just log in, and walk on to the next PC.  Then cycle back after covering the floor to make sure the script completed.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...